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

# Criar OAuth app

> Cria app OAuth do workspace. `clientSecret` retornado **uma vez**. Escopo `oauth_apps:manage`.



## OpenAPI

````yaml /es/oauth-api/api-reference/openapi-oauth.json post /v1/oauth/apps
openapi: 3.0.3
info:
  title: Notifique API. OAuth 2.1
  description: >-
    Authorization Server OAuth 2.1 con PKCE obligatorio. Registra clientes,
    autoriza usuarios y obtén access tokens para `/v1/*`. Issuer:
    `https://api.notifique.dev`.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Produção
security: []
tags:
  - name: Metadados
    description: Discovery RFC 8414, chaves públicas JWT e metadados do recurso MCP.
  - name: OAuth
    description: Registro de clientes, autorização, tokens e revogação.
  - name: OAuth Apps
    description: Apps OAuth do workspace (painel Developer → OAuth Apps).
paths:
  /v1/oauth/apps:
    post:
      tags:
        - OAuth Apps
      summary: Criar OAuth app
      description: >-
        Cria app OAuth do workspace. `clientSecret` retornado **uma vez**.
        Escopo `oauth_apps:manage`.
      operationId: ntfOauth_createWorkspaceApp
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfOauth_WorkspaceAppCreate'
            example:
              name: Meu SaaS
              redirectUris:
                - https://meuapp.com/oauth/callback
              allowedScopes:
                - email:send
                - contacts:read
      responses:
        '200':
          description: App criado.
          content:
            application/json:
              example:
                success: true
                data:
                  id: cloauthapp_01HNEW...
                  name: Meu SaaS
                  clientId: ntf_oauth_cl_abc123
                  clientSecret: ntf_oauth_cs_shown_once_xyz...
                  redirectUris:
                    - https://meuapp.com/oauth/callback
                  scopes:
                    - email:send
                    - contacts:read
              schema:
                $ref: '#/components/schemas/ntfOauth_CreateWorkspaceAppResponse'
        '400':
          $ref: '#/components/responses/NtfOauth_BadRequest'
        '401':
          $ref: '#/components/responses/NtfOauth_Unauthorized'
        '403':
          $ref: '#/components/responses/NtfOauth_Forbidden'
components:
  schemas:
    NtfOauth_WorkspaceAppCreate:
      type: object
      required:
        - name
        - redirectUris
      properties:
        name:
          type: string
        redirectUris:
          type: array
          items:
            type: string
            format: uri
        allowedScopes:
          type: array
          items:
            type: string
          description: Escopos padrão do app.
      example:
        name: Exemplo
        redirectUris:
          - https://example.com/resource
        allowedScopes:
          - string
    ntfOauth_CreateWorkspaceAppResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            clientId:
              type: string
            clientSecret:
              type: string
            redirectUris:
              type: array
              items:
                type: string
            scopes:
              type: array
              items:
                type: string
      example:
        success: true
        data:
          id: clxx...
          name: Exemplo
          clientId: clxx...
          clientSecret: string
          redirectUris:
            - string
          scopes:
            - string
    NtfOauth_Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        message:
          type: string
        code:
          type: string
      example:
        success: false
        error: string
        message: string
        code: string
  responses:
    NtfOauth_BadRequest:
      description: Body inválido ou campo inesperado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfOauth_Error'
          examples:
            validation:
              value:
                success: false
                error: Bad Request
                message: url must be HTTPS
                code: VALIDATION_ERROR
            unexpected_fields:
              value:
                success: false
                code: UNEXPECTED_FIELDS
    NtfOauth_Unauthorized:
      description: Chave ausente, inválida ou revogada.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfOauth_Error'
          example:
            success: false
            error: Unauthorized
            message: Invalid API key
            code: UNAUTHORIZED
    NtfOauth_Forbidden:
      description: Escopo ausente ou recurso fora da permissão da chave.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfOauth_Error'
          example:
            success: false
            error: Forbidden
            message: Missing scope webhooks:manage
            code: FORBIDDEN

````