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

# Create an Application

> Creates an Application and its credentials - clientId and clientSecret.



## OpenAPI

````yaml /es/openapi/v3-current/AM-identity.yaml post /v1/applications
openapi: 3.0.1
info:
  contact: {}
  description: This is a swagger documentation for the Identity API
  termsOfService: http://swagger.io/terms/
  title: Identity API
  version: 1.0.0
servers:
  - url: //localhost:4001/
security: []
paths:
  /v1/applications:
    post:
      tags:
        - Applications
      summary: Create an Application
      description: Creates an Application and its credentials - clientId and clientSecret.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplicationInput'
        description: Application Input
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationResponse'
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg.HTTPError'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg.HTTPError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg.HTTPError'
          description: Internal Server Error
      security:
        - BearerAuth: []
components:
  schemas:
    ApplicationInput:
      description: ApplicationInput payload
      example:
        name: midaz
        description: Identity Used By BR Sisbajud
        source: br-sisbajud
        target: plugin-identity
      properties:
        description:
          description: Description field for any annotation of the application.
          example: Identity Used By BR Sisbajud
          type: string
        name:
          description: >-
            Name is the DEPRECATED alias of Target, kept so every existing
            caller keeps

            working unchanged. Supply Target instead. When both are present
            Target wins.
          example: midaz
          type: string
        source:
          description: >-
            Source is the service that will CONSUME this credential — the
            caller. It

            must also match the available-applications catalog. Optional: when
            supplied

            the application becomes pairwise, exactly like the multi-tenant
            provisioner

            builds it, and the server records the source as the sourceService
            claim so

            the declarations reconciler can answer "who is declaring" from the
            token

            instead of inferring it from DisplayName. When omitted the
            application keeps

            the pre-existing single-tenant shape.
          example: br-sisbajud
          type: string
        target:
          description: >-
            Target is the service this credential is issued FOR — the callee. It
            must

            match an application exposed by GET /v1/applications/available. The
            catalog

            may evolve over time. Required (directly or through the Name alias).
          example: plugin-identity
          type: string
      required:
        - description
      type: object
    ApplicationResponse:
      description: ApplicationResponse payload
      example:
        createdAt: '2021-09-01T00:00:00.000Z'
        clientId: clientId
        name: Midaz
        description: Midaz Used By Application X
        clientSecret: clientSecret
        id: 00000000-0000-0000-0000-000000000000
      properties:
        clientId:
          type: string
        clientSecret:
          description: '#nosec G117 -- auth service, field must be in JSON response'
          type: string
        createdAt:
          example: '2021-09-01T00:00:00.000Z'
          type: string
        description:
          example: Midaz Used By Application X
          type: string
        id:
          example: 00000000-0000-0000-0000-000000000000
          type: string
        name:
          example: Midaz
          type: string
      type: object
    pkg.HTTPError:
      properties:
        code:
          type: string
        entityType:
          type: string
        err:
          type: object
        message:
          type: string
        title:
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      description: 'Bearer authentication. Send Authorization: Bearer <token>.'
      in: header
      name: Authorization
      type: apiKey

````