> ## 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.

# Get connectionsoauth2callback

> FinaliseConnectionCallback is the redirect URL to exchange an authorization code for an access token in an
OAuth2.0 authorization code grant. It must be noted that the real callback URL configured with the
OAuth2.0 provider should be a Switchboard URL (prompted to the user at app-creation time) and not this API URL.




## OpenAPI

````yaml get /connections/oauth2/callback
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:
  /connections/oauth2/callback:
    get:
      tags:
        - apps
        - oauth_callback
        - public
      description: >
        FinaliseConnectionCallback is the redirect URL to exchange an
        authorization code for an access token in an

        OAuth2.0 authorization code grant. It must be noted that the real
        callback URL configured with the

        OAuth2.0 provider should be a Switchboard URL (prompted to the user at
        app-creation time) and not this API URL.
      operationId: FinaliseConnectionCallback
      parameters:
        - name: code
          description: The authorization code to exchange for an access token.
          in: query
          schema:
            type: string
        - name: state
          description: >
            This value is generated by the
            `/organisations/{organisationId}/connection-init` operation and is
            an opaque

            string and should have no meaning to external clients. Internally,
            it's used to verify the flow was

            initialised by Switchboard and connect the authorisation grant to
            the user/organisation who initiated it.
          in: query
          schema:
            type: string
        - name: error
          description: >
            An error code by the OAuth2.0 provider indicating a problem occurred
            during the grant.
          in: query
          schema:
            type: string
        - name: error_description
          description: >
            A human-readable error message associated to the error code
            specified in the `error` parameter.
          in: query
          schema:
            type: string
      responses:
        '201':
          $ref: '#/components/responses/CreateCredentialResponse'
        '204':
          description: >
            The callback has been handled successfully, there is no response to
            this request. In a browser context, the

            user should be redirected back to a suitable location.
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  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:
    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

````