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

# Consultar aplicação OAuth

> Retorna uma aplicação OAuth por ID, com clients e redirect URIs.

Permissão: `oauth-apps/get`.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET 'https://api.goatpay.com.br/v1/oauth-apps/get/clx_app_01' \
    -H 'X-API-Key: gp_live_SUA_CHAVE'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "message": "Aplicação OAuth consultada com sucesso",
    "data": {
      "item": {
        "id": "clx_app_01",
        "name": "ERP Parceiro",
        "description": "Integração de cobranças",
        "status": "ACTIVE",
        "allowedScopes": ["account:read", "payments:read"],
        "developerName": "Sua Empresa LTDA",
        "website": "https://sua-app.com",
        "lastUsedAt": "2026-09-03T18:30:00.000Z",
        "createdAt": "2026-08-15T10:00:00.000Z",
        "clients": [
          {
            "id": "clx_client_prod",
            "environment": "PRODUCTION",
            "clientId": "gp_oauth_live_x9y8z7...",
            "clientSecretPreview": "gp_oauth_live_...****",
            "status": "ACTIVE",
            "redirectUris": [
              { "id": "clx_uri_2", "uri": "https://sua-app.com/oauth/callback" }
            ]
          }
        ]
      }
    },
    "requestId": "req_oauth_get"
  }
  ```
</ResponseExample>

### Parâmetros

<ParamField path="id" type="string" required>
  ID da aplicação OAuth.
</ParamField>


## OpenAPI

````yaml GET /oauth-apps/get/{id}
openapi: 3.1.0
info:
  title: GoatPay API
  description: >
    API pública merchant da GoatPay. Autenticação via header `X-API-Key:
    gp_live_...`.

    Respostas de sucesso usam o envelope `{ success, message, data, requestId
    }`.

    Campos internos (`accountId`, `metadata`, histórico de entregas de webhook,
    etc.) não são expostos.

    `providerTransactionId` aparece como `referenceId`; `providerInfractionId`
    como `infractionId`.

    Rate limit global: 100 requisições por minuto por API key (HTTP 429). Sem
    chave, limite por IP.
  version: 1.0.0
servers:
  - url: https://api.goatpay.com.br/v1
    description: Produção
security:
  - apiKeyAuth: []
tags:
  - name: pix
    description: >-
      Cobranças PIX (receber), reembolsos de depósito recebido e transferências
      PIX (enviar). Alias legado em payouts/* para envios.
  - name: transfer-internal
    description: Transferências entre contas GoatPay
  - name: transfer-scheduled
    description: Transferências programadas (agendar, repetir ou por saldo)
  - name: crypto
    description: Depósitos e transferências em criptomoeda
  - name: billings
    description: >-
      Cobranças avulsas (pagamento único) — boleto, cartão ou PIX na Conta
      Padrão (PF ou PJ)
  - name: subscriptions
    description: >-
      Assinaturas recorrentes com ciclo fixo — boleto, cartão ou PIX na Conta
      Padrão (PF ou PJ)
  - name: account
    description: Saldo e extrato
  - name: subaccount
    description: Subcontas merchant (carteiras lógicas sob a conta principal)
  - name: meds
    description: Disputas MED
  - name: webhooks
    description: Endpoints de webhook de saída
  - name: oauth
    description: OAuth 2.0 — autorização de terceiros (fora do prefixo /v1)
  - name: oauth-apps
    description: Gestão de aplicações OAuth (prefixo /v1, API key)
  - name: payouts
    description: Alias de transfer-pix para saques PIX
  - name: customers
    description: Clientes da loja (CRM)
  - name: products
    description: Produtos e entregas digitais
  - name: coupons
    description: Cupons de desconto para links
  - name: payment-links
    description: Links de pagamento e checkout hospedado
paths:
  /oauth-apps/get/{id}:
    get:
      tags:
        - oauth-apps
      summary: Consultar aplicação OAuth
      description: Retorna app com clients e redirect URIs. Permissão `oauth-apps/get`.
      operationId: oauthAppsGet
      parameters:
        - $ref: '#/components/parameters/ResourceId'
      responses:
        '200':
          $ref: '#/components/responses/OAuthAppsItemSuccess'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    ResourceId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: ID do recurso (transação, cobrança, webhook, etc.)
  responses:
    OAuthAppsItemSuccess:
      description: Aplicação OAuth consultada, criada ou atualizada.
      content:
        application/json:
          schema:
            type: object
            required:
              - success
              - message
              - data
            properties:
              success:
                type: boolean
              message:
                type: string
              data:
                $ref: '#/components/schemas/PublicOAuth2ApplicationItemData'
              requestId:
                type: string
    Unauthorized:
      description: Chave ausente, inválida ou revogada.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: Chave sem permissão para este endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: Recurso não encontrado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  schemas:
    PublicOAuth2ApplicationItemData:
      type: object
      properties:
        item:
          $ref: '#/components/schemas/PublicOAuth2Application'
    ErrorEnvelope:
      type: object
      required:
        - success
        - message
        - error
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Subconta inativa
        error:
          type: object
          properties:
            code:
              type: string
              example: Bad Request
            statusCode:
              type: integer
              example: 400
        requestId:
          type: string
          example: req_abc123
    PublicOAuth2Application:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        logoUrl:
          type: string
          format: uri
          nullable: true
        website:
          type: string
          format: uri
          nullable: true
        privacyPolicyUrl:
          type: string
          format: uri
          nullable: true
        termsUrl:
          type: string
          format: uri
          nullable: true
        developerName:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - ACTIVE
            - DISABLED
        allowedScopes:
          type: array
          items:
            type: string
        lastUsedAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        clients:
          type: array
          items:
            $ref: '#/components/schemas/PublicOAuth2Client'
    PublicOAuth2Client:
      type: object
      properties:
        id:
          type: string
        environment:
          type: string
          enum:
            - DEV
            - PRODUCTION
        clientId:
          type: string
          example: gp_oauth_dev_...
        clientSecretPreview:
          type: string
          example: gp_oauth_dev_...****
        status:
          type: string
        redirectUris:
          type: array
          items:
            $ref: '#/components/schemas/PublicOAuth2RedirectUri'
    PublicOAuth2RedirectUri:
      type: object
      properties:
        id:
          type: string
        uri:
          type: string
          format: uri
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Chave `gp_live_...` criada em Integrações → Chaves de API no dashboard.

````