# /api/v3/storages/{id}/oauth_client_credentials
---
post:
  summary: Creates an oauth client credentials object for a storage.
  operationId: create_storage_oauth_credentials
  tags:
    - File links
  description: |-
    Inserts the OAuth 2 credentials into the storage, to allow the storage to act as an OAuth 2 client. Calling this
    endpoint on a storage that already contains OAuth 2 client credentials will replace them.
  parameters:
    - name: id
      description: Storage id
      in: path
      required: true
      schema:
        type: integer
      example: 1337
  requestBody:
    content:
      application/json:
        schema:
          $ref: '../components/schemas/oauth_client_credentials_write_model.yml'
  responses:
    '201':
      description: Created
      content:
        application/hal+json:
          schema:
            $ref: '../components/schemas/storage_read_model.yml'
    '403':
      content:
        application/hal+json:
          schema:
            $ref: '../components/schemas/error_response.yml'
          examples:
            response:
              value:
                _type: Error
                errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
                message: You are not authorized to access this resource.
      description: |-
        Returned if the client does not have sufficient permissions.

        **Required permission:** admin
    '404':
      content:
        application/hal+json:
          schema:
            $ref: '../components/schemas/error_response.yml'
          example:
            _type: Error
            errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
            message: The requested resource could not be found.
      description: |-
        Returned if the storage does not exist or the client does not have sufficient permissions to see it.

        **Required permission:** view file links
