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

# Create App Token

> Exchange the app's client id and secret (Basic) for a 15 minute access token.

Only embedded-app clients with an enabled install are served. ``scope`` narrows the
grant; scopes the install does not approve are dropped, and a grant with none left is
refused with ``invalid_scope``. There is no refresh token: request a new one.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/apps/v1/token
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/apps/v1/token:
    post:
      tags:
        - embedded-apps
      summary: Create App Token
      description: >-
        Exchange the app's client id and secret (Basic) for a 15 minute access
        token.


        Only embedded-app clients with an enabled install are served. ``scope``
        narrows the

        grant; scopes the install does not approve are dropped, and a grant with
        none left is

        refused with ``invalid_scope``. There is no refresh token: request a new
        one.
      operationId: embedded_apps.post_embedded_apps_post_apps_v1_token
      parameters:
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/AppTokenRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiResponse_AppTokenAttributes_'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    AppTokenRequest:
      additionalProperties: false
      description: >-
        Client-credentials grant. ``scope`` is space-delimited; omitted means
        all approved.
      properties:
        grant_type:
          const: client_credentials
          title: Grant Type
          type: string
        scope:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          title: Scope
      required:
        - grant_type
      title: AppTokenRequest
      type: object
    JsonApiResponse_AppTokenAttributes_:
      properties:
        data:
          $ref: '#/components/schemas/JsonApiResource_AppTokenAttributes_'
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: JsonApiResponse[AppTokenAttributes]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    JsonApiResource_AppTokenAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/AppTokenAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[AppTokenAttributes]
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    AppTokenAttributes:
      properties:
        access_token:
          title: Access Token
          type: string
        expires_in:
          title: Expires In
          type: integer
        scope:
          title: Scope
          type: string
        token_type:
          const: Bearer
          default: Bearer
          title: Token Type
          type: string
      required:
        - access_token
        - expires_in
        - scope
      title: AppTokenAttributes
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.