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

# Create claims mapping config

> Create a claims mapping configuration for the application.



## OpenAPI

````yaml post /v2/session/apps/{appID}/config/claims
openapi: 3.1.1
info:
  title: Prelude Session Management API
  version: 0.0.1
  summary: The Prelude API for Session Management
  description: The Prelude API for Session Management.
  contact:
    email: support@prelude.so
    url: https://prelude.so
servers:
  - url: https://api.prelude.dev
    description: Production server
security:
  - Authorization: []
tags:
  - name: Mode
    description: Manage the mode (dev/prod) of your application.
  - name: Users
    description: Manage the users of your application.
  - name: Webhooks
    description: Manage the webhooks of your application.
  - name: Domains
    description: Manage the domains of your application.
  - name: Config - Scopes
    description: Manage the scope configuration of your application.
  - name: Config - Claims
    description: Manage the claims mapping configuration of your application.
  - name: Config - Step-up
    description: Manage the step-up authentication configuration of your application.
  - name: Config - Migration
    description: Manage the user migration configuration of your application.
  - name: Config - Login OTP
    description: Manage the OTP login configuration of your application.
  - name: Config - Login OAuth
    description: Manage the OAuth login configuration of your application.
  - name: Config - Login Password
    description: Manage the password login configuration of your application.
paths:
  /v2/session/apps/{appID}/config/claims:
    parameters:
      - $ref: '#/components/parameters/appIDParam'
    post:
      tags:
        - Config - Claims
      summary: Create claims mapping config
      description: Create a claims mapping configuration for the application.
      operationId: createClaimsMappingConfig
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostClaimsMappingConfigRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimsMappingConfigWrapper'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/InvalidRequestError'
                  - $ref: '#/components/schemas/InvalidClaimOverrideError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppNotFoundError'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimsMappingConfigAlreadyExistsError'
components:
  parameters:
    appIDParam:
      in: path
      name: appID
      required: true
      description: The id of the app the request refers to.
      schema:
        $ref: '#/components/schemas/AppID'
  schemas:
    PostClaimsMappingConfigRequest:
      type: object
      properties:
        mapping:
          type: object
          additionalProperties: true
          examples:
            - custom_claim: profile.first_name
              role: profile.role
      required:
        - mapping
    ClaimsMappingConfigWrapper:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/ClaimsMappingConfig'
      required:
        - config
    InvalidRequestError:
      type: object
      properties:
        code:
          type: string
          enum:
            - invalid_request
          examples:
            - invalid_request
        status:
          type: string
          enum:
            - bad_request
          examples:
            - bad_request
        message:
          type: string
          examples:
            - The request body is invalid.
      required:
        - code
        - status
        - message
    InvalidClaimOverrideError:
      type: object
      properties:
        code:
          type: string
          enum:
            - invalid_claim_override
          examples:
            - invalid_claim_override
        status:
          type: string
          enum:
            - bad_request
          examples:
            - bad_request
        message:
          type: string
          examples:
            - The claim override is invalid.
      required:
        - code
        - status
        - message
    AppNotFoundError:
      type: object
      properties:
        code:
          type: string
          enum:
            - app_not_found
          examples:
            - app_not_found
        status:
          type: string
          enum:
            - not_found
          examples:
            - not_found
        message:
          type: string
          examples:
            - The application was not found.
      required:
        - code
        - status
        - message
    ClaimsMappingConfigAlreadyExistsError:
      type: object
      properties:
        code:
          type: string
          enum:
            - claims_mapping_config_already_exists
          examples:
            - claims_mapping_config_already_exists
        status:
          type: string
          enum:
            - conflict
          examples:
            - conflict
        message:
          type: string
          examples:
            - >-
              A claims mapping configuration already exists for this
              application.
      required:
        - code
        - status
        - message
    AppID:
      type: string
      description: An application's unique identifier.
      examples:
        - 54e9ujn
        - fvua38g
    ClaimsMappingConfig:
      type: object
      properties:
        mapping:
          type: object
          additionalProperties: true
          examples:
            - custom_claim: profile.first_name
              role: profile.role
        version:
          type: integer
          examples:
            - 1
        created_at:
          type: string
          format: date-time
          examples:
            - '2025-03-15T10:30:00Z'
        updated_at:
          type: string
          format: date-time
          examples:
            - '2025-03-15T12:00:00Z'
      required:
        - mapping
        - version
        - created_at
        - updated_at
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````