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

# Criar hash de consulta

> Cria nova hash de consulta. Quando `isConsentimento` for `true` e `idPgccConsentimento` for informado, o hash é gerado vinculado ao consentimento identificado pelo ID do consentimento no PGCC. Caso contrário, o hash é gerado sem vínculo com consentimento.



## OpenAPI

````yaml https://public-usuario-api.autorize.com.br/swagger/v1/swagger.json post /api/hash-consulta
openapi: 3.0.4
info:
  title: GCC Usuario Public API
  version: dev
servers:
  - url: https://public-usuario-api.autorize.com.br
    description: Produ??o
  - url: https://staging-usuario-public-api.autorize.com.br
    description: Staging
security: []
tags:
  - name: HashConsulta
  - name: SolicitacaoConsentimento
paths:
  /api/hash-consulta:
    post:
      tags:
        - HashConsulta
      summary: Criar hash de consulta
      description: >-
        Cria nova hash de consulta. Quando `isConsentimento` for `true` e
        `idPgccConsentimento` for informado, o hash é gerado vinculado ao
        consentimento identificado pelo ID do consentimento no PGCC. Caso
        contrário, o hash é gerado sem vínculo com consentimento.
      parameters:
        - name: Api-Key
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHashCommand'
          text/json:
            schema:
              $ref: '#/components/schemas/CreateHashCommand'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CreateHashCommand'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/CreateHashResponsePadrao'
            application/json:
              schema:
                $ref: '#/components/schemas/CreateHashResponsePadrao'
            text/json:
              schema:
                $ref: '#/components/schemas/CreateHashResponsePadrao'
components:
  schemas:
    CreateHashCommand:
      type: object
      properties:
        templateId:
          type: string
          description: Identificador do template do caso de uso.
          nullable: true
        isConsentimento:
          type: boolean
          description: Indica se a hash está associada a um consentimento.
          nullable: true
        idPgccConsentimento:
          type: string
          description: >-
            Identificador do consentimento na PGCC. Obrigatório quando
            IsConsentimento for verdadeiro.
          nullable: true
        cnpjAnuente:
          type: string
          description: >-
            CNPJ do anuente. Obrigatório somente em modalidade de acesso
            "Indireto".
          nullable: true
        dataExpiracao:
          type: string
          description: Data de expiração da hash de consulta.
          format: date-time
          nullable: true
        cpfOperador:
          type: string
          description: CPF do operador responsável pela criação da hash.
          nullable: true
      additionalProperties: false
    CreateHashResponsePadrao:
      type: object
      properties:
        sucesso:
          type: boolean
        isPgccErro:
          type: boolean
        pgccCodigoErro:
          $ref: '#/components/schemas/HttpStatusCode'
        mensagem:
          type: string
          nullable: true
        data:
          $ref: '#/components/schemas/CreateHashResult'
      additionalProperties: false
    HttpStatusCode:
      enum:
        - Continue
        - SwitchingProtocols
        - Processing
        - EarlyHints
        - OK
        - Created
        - Accepted
        - NonAuthoritativeInformation
        - NoContent
        - ResetContent
        - PartialContent
        - MultiStatus
        - AlreadyReported
        - IMUsed
        - MultipleChoices
        - MovedPermanently
        - Found
        - SeeOther
        - NotModified
        - UseProxy
        - Unused
        - TemporaryRedirect
        - PermanentRedirect
        - BadRequest
        - Unauthorized
        - PaymentRequired
        - Forbidden
        - NotFound
        - MethodNotAllowed
        - NotAcceptable
        - ProxyAuthenticationRequired
        - RequestTimeout
        - Conflict
        - Gone
        - LengthRequired
        - PreconditionFailed
        - RequestEntityTooLarge
        - RequestUriTooLong
        - UnsupportedMediaType
        - RequestedRangeNotSatisfiable
        - ExpectationFailed
        - MisdirectedRequest
        - UnprocessableEntity
        - Locked
        - FailedDependency
        - UpgradeRequired
        - PreconditionRequired
        - TooManyRequests
        - RequestHeaderFieldsTooLarge
        - UnavailableForLegalReasons
        - InternalServerError
        - NotImplemented
        - BadGateway
        - ServiceUnavailable
        - GatewayTimeout
        - HttpVersionNotSupported
        - VariantAlsoNegotiates
        - InsufficientStorage
        - LoopDetected
        - NotExtended
        - NetworkAuthenticationRequired
      type: string
    CreateHashResult:
      required:
        - hash
      type: object
      properties:
        id:
          type: string
          format: uuid
        hash:
          type: string
          nullable: true
      additionalProperties: false

````