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

# Create authorization for a user

> With this endpoint you can create an authorization code for a user. Note: the bearer token needs special privilege to perform this task, please contact your contact person at Findity if you need this access.  
To address a user you need to provide the id or externalSourceId from the person object.



## OpenAPI

````yaml /openapi/authentication.json post /oauth/authorization-grant
openapi: 3.0.3
info:
  title: Authentication
  description: Authentication
  version: 1.0.0
servers:
  - url: https://stage-api.findity.com/api
  - url: https://api.findity.com/api
security:
  - bearerAuth: []
paths:
  /oauth/authorization-grant:
    post:
      tags:
        - Token
      summary: Create authorization for a user
      description: >-
        With this endpoint you can create an authorization code for a user.
        Note: the bearer token needs special privilege to perform this task,
        please contact your contact person at Findity if you need this access.  

        To address a user you need to provide the id or externalSourceId from
        the person object.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/oauth-authorization-grant-request'
            example:
              user_id: 8ab28c3e6f8023c3016f8046be110002
              external_user_id: ca2c4726-b376-11ed-8a5b-ebc76439f541
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/oauth-authorization-grant-response'
              example:
                code: 713ebf7ef91559f99c5ef9edfcab345c
components:
  schemas:
    oauth-authorization-grant-request:
      type: object
      properties:
        user_id:
          type: string
          description: >-
            Internal user id (personId). Any user can use this endpoint with
            their own user_id, other use cases requires special permissions.
        external_user_id:
          type: string
          description: External user id (externalSourceId for person).
      example:
        user_id: 8ab28c3e6f8023c3016f8046be110002
        external_user_id: ca2c4726-b376-11ed-8a5b-ebc76439f541
    oauth-authorization-grant-response:
      type: object
      properties:
        code:
          type: string
          description: Authorization code that can be used in a request to /oauth/token
      example:
        code: 713ebf7ef91559f99c5ef9edfcab345c
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````