> ## Documentation Index
> Fetch the complete documentation index at: https://docs.versori.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Post organisations credentials

> CreateCredential allows users to create new Credentials. Valid requests which return a credential marked as
"invalid" is normal behaviour, but the credential won't be usable until it's updated to become valid.




## OpenAPI

````yaml post /organisations/{organisationId}/credentials
openapi: 3.0.3
info:
  title: Switchboard API
  description: >-
    The Switchboard API provides users the ability to manage their Apps,
    Integrations and Workflows
  version: 0.0.1-alpha.0
servers:
  - url: https://platform.versori.com/api/switchboard/v1alpha1/
    description: Production server
  - url: http://localhost:8080/v1alpha1/
    description: Localhost
security:
  - apiKey: []
paths:
  /organisations/{organisationId}/credentials:
    post:
      tags:
        - credentials
        - not-implemented
      description: >
        CreateCredential allows users to create new Credentials. Valid requests
        which return a credential marked as

        "invalid" is normal behaviour, but the credential won't be usable until
        it's updated to become valid.
      operationId: CreateCredential
      parameters:
        - name: organisationId
          in: path
          required: true
          schema:
            type: string
          example: '101'
      requestBody:
        $ref: '#/components/requestBodies/CreateCredentialRequest'
      responses:
        '201':
          $ref: '#/components/responses/CreateCredentialResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  requestBodies:
    CreateCredentialRequest:
      description: >
        CreateCredentialRequest is the request definition for creating a new
        credential.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateCredentialRequestBody'
  responses:
    CreateCredentialResponse:
      description: |
        CreateCredentialResponse is the response containing the new credential.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Credential'
    ErrorResponse:
      description: The default error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    CreateCredentialRequestBody:
      description: >
        CreateCredentialRequestBody is the request body to create a new
        credential. The ID is automatically generated

        and the organisation ID is defined by the request's path parameter.
      properties:
        name:
          description: Name is the credential name.
          type: string
        data:
          description: >-
            Data is a map of string keys to string base64 encoded values for the
            actual credential data.
          type: object
        type:
          $ref: '#/components/schemas/CredentialType'
        redactFields:
          description: >
            RedactFields is a list of fields within data which once created
            should not be returned to the user. This

            property is only applicable for "Default" credential types.
            Credentials of other types have their own

            redaction list internally and this field will be ignored.
          type: array
          items:
            type: string
        expiresAt:
          description: >
            ExpiresAt allows the user to specify when Switchboard should
            automatically delete the credential.
          type: string
          format: date-time
      required:
        - name
        - data
        - type
    Credential:
      description: >
        Credential holds sensitive data not owned by Versori. Users can create
        credentials so that Versori systems can

        authenticate to external services on behalf of the user.
      properties:
        id:
          description: ID is the identifier for the credential.
          type: string
        organisationID:
          description: >-
            OrganisationID is the ID of the organisation which owns this
            credential.
        name:
          description: Name is the credential name.
          type: string
        data:
          description: >-
            Data is a map of string keys to string base64 encoded values for the
            actual credential data.
          type: object
        type:
          $ref: '#/components/schemas/CredentialType'
        redactFields:
          description: >
            RedactFields is a list of fields within data which once created
            should not be returned to the user. This

            property is only applicable for "Default" credential types.
            Credentials of other types have their own

            redaction list internally and this field will be ignored.
          type: array
          items:
            type: string
        expiresAt:
          description: >
            ExpiresAt allows the user to specify when Switchboard should
            automatically delete the credential.
          type: string
          format: date-time
      required:
        - id
        - organisationID
        - name
        - data
        - type
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        extensions:
          type: object
      required:
        - code
        - message
    CredentialType:
      description: >
        Type provides additional context to what data the credential contains.
        Certain types dictate that certain fields

        must be set in order for the credential to be considered valid:


        - "Default" is the default type for a Credential. Data may contain
        arbitrary properties and will always be
          considered valid.
        - "OAuth2Refresh" signifies the credential is to be used for issuing
        OAuth 2.0 access tokens based on a refresh
          token. The credential data must json-marshal into a CredentialDataOAuth2Refresh in order to be valid.
          Credentials of this type may only be created or updated via the connections APIs, not by the credentials APIs.
        - "Raw" signifies the credential contains a value which can be used
        until the credential expires (or never if
          the credential has no expiry). The credential data must json-marshal into a CredentialDataRaw in order to be
          valid.
        - "BasicAuth" signifies the credential contains credentials to be used
        in HTTP Basic authentication schemes. The
          credential data must json-marshal into a CredentialDataBasicAuth in order to be valid.
      type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization

````