> ## 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 a Claim

> Use this endpoint to create a new key claim for portability or
ownership. Not every type of key can be claimed or ported. The table
below defines the possibilities:


| **compatible?** | **OWNERSHIP** | **PORTABILITY** |

|-------------------|---------------|-----------------|

| CPF               |               | Yes             |

| CNPJ              |               | Yes             |

| PHONE             | Yes           | Yes             |

| EMAIL             |               | Yes             |

| EVP               |               |                 |


**Notes:**

- OWNERSHIP claims are only allowed for PHONE key types.

- PORTABILITY claims are allowed for CPF, CNPJ, PHONE, and EMAIL key
types.

- EVP keys cannot be claimed or ported.

- The claimer account information is automatically retrieved from CRM
using the X-Account-Id header.

- The claim enters OPEN status upon creation and awaits acknowledgment
from the donor participant.



## OpenAPI

````yaml /en/openapi/v3-current/indirect-pix.yaml post /v1/dict/claims
openapi: 3.0.3
info:
  title: Plugin BR Pix Indirect - Complete API
  description: |
    Complete API for Brazilian Pix instant payment system including
    Pix key dictionary operations, QR code generation/decoding, transactions and
    transaction limits.
  version: 1.0.0
servers:
  - url: https://plugin-pix-indirect.api.lerian.net
security:
  - bearerAuth: []
paths:
  /v1/dict/claims:
    post:
      tags:
        - Claims API
      summary: Create a Claim
      description: |-
        Use this endpoint to create a new key claim for portability or
        ownership. Not every type of key can be claimed or ported. The table
        below defines the possibilities:


        | **compatible?** | **OWNERSHIP** | **PORTABILITY** |

        |-------------------|---------------|-----------------|

        | CPF               |               | Yes             |

        | CNPJ              |               | Yes             |

        | PHONE             | Yes           | Yes             |

        | EMAIL             |               | Yes             |

        | EVP               |               |                 |


        **Notes:**

        - OWNERSHIP claims are only allowed for PHONE key types.

        - PORTABILITY claims are allowed for CPF, CNPJ, PHONE, and EMAIL key
        types.

        - EVP keys cannot be claimed or ported.

        - The claimer account information is automatically retrieved from CRM
        using the X-Account-Id header.

        - The claim enters OPEN status upon creation and awaits acknowledgment
        from the donor participant.
      parameters:
        - $ref: '#/components/parameters/XAccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClaimInput'
            example:
              key: '+5561988887777'
              type: OWNERSHIP
      responses:
        '201':
          description: Claim created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimObject'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0001:
                  $ref: '#/components/examples/ErrorPIX0001'
                ErrorPIX0003:
                  $ref: '#/components/examples/ErrorPIX0003'
                ErrorPIX0004:
                  $ref: '#/components/examples/ErrorPIX0004'
                ErrorPIX0102:
                  $ref: '#/components/examples/ErrorPIX0102'
                ErrorPIX0118:
                  $ref: '#/components/examples/ErrorPIX0118'
                ErrorPIX0120:
                  $ref: '#/components/examples/ErrorPIX0120'
                ErrorPIX0121:
                  $ref: '#/components/examples/ErrorPIX0121'
                ErrorPIX0122:
                  $ref: '#/components/examples/ErrorPIX0122'
                ErrorPIX0124:
                  $ref: '#/components/examples/ErrorPIX0124'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0119:
                  $ref: '#/components/examples/ErrorPIX0119'
                ErrorPIX0123:
                  $ref: '#/components/examples/ErrorPIX0123'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0000:
                  $ref: '#/components/examples/ErrorPIX0000'
                ErrorPIX0500:
                  $ref: '#/components/examples/ErrorPIX0500'
                ErrorPIX0599:
                  $ref: '#/components/examples/ErrorPIX0599'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX1000:
                  $ref: '#/components/examples/ErrorPIX1000'
                ErrorPIX1007:
                  $ref: '#/components/examples/ErrorPIX1007'
                ErrorPIX1099:
                  $ref: '#/components/examples/ErrorPIX1099'
      deprecated: false
      security:
        - bearerAuth: []
components:
  parameters:
    XAccountId:
      name: X-Account-Id
      in: header
      description: Unique identifier of the Midaz Ledger Account (UUID format).
      required: true
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
  schemas:
    CreateClaimInput:
      type: object
      required:
        - key
        - type
      properties:
        key:
          type: string
          description: Pix key value to claim.
          example: '+5561988887777'
        type:
          type: string
          description: Type of claim.
          enum:
            - OWNERSHIP
            - PORTABILITY
          example: OWNERSHIP
    ClaimObject:
      type: object
      properties:
        id:
          type: string
          description: Internal UUID of the claim.
          example: 019c96a0-0c3e-77b5-8321-4807058a67bb
        bacenClaimId:
          type: string
          description: BACEN DICT identifier for this claim.
          example: 019c96a0-0d16-7184-ad7f-38545eeb671c
        key:
          type: string
          description: The Pix key value being claimed.
          example: '+5561988887777'
        keyType:
          type: string
          description: Type of Pix key.
          example: PHONE
        type:
          type: string
          description: Type of claim.
          enum:
            - OWNERSHIP
            - PORTABILITY
          example: OWNERSHIP
        status:
          type: string
          description: Current status of the claim.
          enum:
            - OPEN
            - WAITING_RESOLUTION
            - CONFIRMED
            - CANCELLED
            - COMPLETED
          example: OPEN
        donorParticipant:
          type: string
          description: ISPB of the donor PSP.
          example: '30306294'
        resolutionPeriodEnd:
          type: string
          format: date-time
          description: Deadline for donor response (D+7 from creation).
          example: '2024-01-22T10:30:00Z'
        completionPeriodEnd:
          type: string
          format: date-time
          description: Deadline for claim completion (D+14 from creation).
          example: '2024-01-29T10:30:00Z'
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the claim was created.
          example: '2024-01-15T10:30:00Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the claim was last updated.
          example: '2024-01-15T10:30:00Z'
    ErrorFormat:
      type: object
      description: The response message error.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
  examples:
    ErrorPIX0001:
      summary: Missing Headers in Request
      value:
        code: PIX-0001
        title: Missing Headers in Request
        message: >-
          Your request is missing one or more required header params. Please
          refer to the documentation to ensure all necessary header params are
          included in your request.
    ErrorPIX0003:
      summary: Missing Fields in Request
      value:
        code: PIX-0003
        title: Missing Fields in Request
        message: >-
          Your request is missing one or more required fields. Please refer to
          the documentation to ensure all necessary fields are included in your
          request.
    ErrorPIX0004:
      summary: Invalid Field Values in Request
      value:
        code: PIX-0004
        title: Invalid Field Values in Request
        message: >-
          Your request contains one or more fields with invalid values. Please
          refer to the documentation to verify that all fields have the correct
          values.
    ErrorPIX0102:
      summary: Invalid Key Format
      value:
        code: PIX-0102
        title: Invalid Key Format
        message: Invalid format for the specified keyType.
    ErrorPIX0118:
      summary: Key Claim Type Not Allowed
      value:
        code: PIX-0118
        title: Key Claim Type Not Allowed
        message: Only PHONE keys are allowed for ownership claims.
    ErrorPIX0120:
      summary: Key Does Not Exist
      value:
        code: PIX-0120
        title: Key Does Not Exist
        message: The Pix key does not exist in DICT.
    ErrorPIX0121:
      summary: Pix Key Locked By Claim
      value:
        code: PIX-0121
        title: Pix Key Locked By Claim
        message: The Pix key is currently locked by another claim process.
    ErrorPIX0122:
      summary: EVP Key Cannot Be Claimed
      value:
        code: PIX-0122
        title: EVP Key Cannot Be Claimed
        message: EVP keys cannot be claimed.
    ErrorPIX0124:
      summary: Cannot Claim Key
      value:
        code: PIX-0124
        title: Cannot Claim Key
        message: It is not possible to claim this key.
    ErrorPIX0119:
      summary: Pix Key Already Claimed
      value:
        code: PIX-0119
        title: Pix Key Already Claimed
        message: You already have a claim in progress for this key.
    ErrorPIX0123:
      summary: Key Already Belongs to Holder
      value:
        code: PIX-0123
        title: Key Already Belongs to Holder
        message: The Pix key is already linked to the requesting holder.
    ErrorPIX0000:
      summary: Internal Server Error
      value:
        code: PIX-0000
        title: Internal Server Error
        message: The server encountered an unexpected error. Please try again later.
    ErrorPIX0500:
      summary: CRM Connection Error
      value:
        code: PIX-0500
        title: CRM Connection Error
        message: Failed to connect to CRM service.
    ErrorPIX0599:
      summary: CRM Bad Request
      value:
        code: PIX-0599
        title: CRM Bad Request
        message: CRM returned a bad request error.
    ErrorPIX1000:
      summary: Provider Connection Error
      value:
        code: PIX-1000
        title: Provider Connection Error
        message: Failed to connect to provider.
    ErrorPIX1007:
      summary: Provider Internal Error
      value:
        code: PIX-1007
        title: Provider Internal Error
        message: Provider returned an internal error.
    ErrorPIX1099:
      summary: Provider Unmapped Error
      value:
        code: PIX-1099
        title: Provider Unmapped Error
        message: Provider returned an unmapped error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````