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

# Create credentials

> Endpoint used for creating of credentials



## OpenAPI

````yaml /public/tinapiv8.yaml post /oauth
openapi: 3.0.0
info:
  version: 2.4.2
  title: TINAPI
servers: []
security:
  - apiKeyAuth: []
  - apiTokenAuth: []
tags:
  - name: Action
    description: Endpoint related to actions (transactions) in TIN platform
  - name: Transfer
    description: Endpoint related to transfers in TIN platform
  - name: Token
    description: Endpoint related to token in TIN platform
paths:
  /oauth:
    post:
      tags:
        - Credentials
      summary: Create credentials
      description: Endpoint used for creating of credentials
      operationId: createCredentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCredentialsRequest'
        required: true
      responses:
        '200':
          description: Credentials created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCredentialsResponse'
        '400':
          description: Credentials error message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: User doesn't have permissions to create credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorForbidden'
      security:
        - apiKeyAuth: []
        - apiTokenAuth:
            - create_user_credentials
            - create_domain_credentials
            - create_organization_credentials
            - create_all_credentials
            - manage_user_credentials
            - manage_domain_credentials
            - manage_organization_credentials
            - manage_all_credentials
components:
  schemas:
    CreateCredentialsRequest:
      type: object
      properties:
        handle:
          type: string
        _auth:
          $ref: '#/components/schemas/AuthMetadata'
        scopes:
          type: array
          items:
            type: string
        roles:
          type: array
          items:
            type: string
    CreateCredentialsResponse:
      $ref: '#/components/schemas/Credentials'
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/GenericError'
    ErrorForbidden:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        details:
          type: object
    AuthMetadata:
      type: object
      properties:
        owner:
          type: string
        realm:
          type: string
        organization:
          type: string
        domain:
          type: string
    Credentials:
      type: object
      properties:
        handle:
          type: string
        client_id:
          type: string
        client_secret:
          type: string
        api_key:
          type: string
        _auth:
          $ref: '#/components/schemas/AuthMetadata'
        scopes:
          type: array
          items:
            type: string
        roles:
          type: array
          items:
            type: string
        created:
          type: string
        updated:
          type: string
    GenericError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        details:
          type: object
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
    apiTokenAuth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes:
            create_user_credentials: Grants access to create credentials for user
            create_domain_credentials: Grants access to create credentials for domain
            create_organization_credentials: Grants access to create credentials for bank
            create_all_credentials: Grants access to create credentials for all
            read_user_credentials: Grants access to read user credentials
            read_domain_credentials: Grants access to read domain credentials
            read_organization_credentials: Grants access to read bank credentials
            read_all_credentials: Grants access to read all credentials
            update_user_credentials: Grants access to update user credentials
            update_domain_credentials: Grants access to update domain credentials
            update_organization_credentials: Grants access to update bank credentials
            update_all_credentials: Grants access to update all credentials
            manage_user_credentials: Grants access to manage user credentials
            manage_domain_credentials: Grants access to manage domain credentials
            manage_organization_credentials: Grants access to manage bank credentials
            manage_all_credentials: Grants access to manage all credentials

````