Appwrite Tokens API

The Tokens service allows you to create and manage resource tokens for secure file access. 5 operations across 2 paths in the Appwrite 2.0.0 OpenAPI.

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /tokens/buckets/{bucketId}/files/{fileId} List access tokens issued for a stored file · List tokens #
Ask an LLM
“Which share tokens have already been created for a file in my Appwrite storage bucket?”
“Can I filter the list of tokens that exist for one stored file?”
Tell an agent
List every token issued for file {fileId} in bucket {bucketId}.
Show the tokens on file {fileId} in bucket {bucketId} matching {queries}.
POST /tokens/buckets/{bucketId}/files/{fileId} Create a shareable access token for a file · Create file token #
Ask an LLM
“How do I generate a token so someone can open a stored file through a URL parameter?”
“Can a file access token be set to expire at a specific date?”
Tell an agent
Create a new access token for file {fileId} in bucket {bucketId}.
Issue a token for file {fileId} in bucket {bucketId} that expires at {expire}.
GET /tokens/{tokenId} Look up a single file token by ID · Get token #
Ask an LLM
“What are the details and expiry of a specific file token?”
“Can I fetch one token by its ID without knowing its file?”
Tell an agent
Get the details of token {tokenId}.
Show me when token {tokenId} expires.
PATCH /tokens/{tokenId} Change the expiry date of a file token · Update token #
Ask an LLM
“Can I extend the expiry of a file token I already created?”
“What field do I change to make an existing file token expire sooner?”
Tell an agent
Set the expiry of token {tokenId} to {expire}.
Extend existing token {tokenId} so it now expires at {expire}.
DELETE /tokens/{tokenId} Delete a file access token · Delete token #
Ask an LLM
“How do I stop a file token from granting access by removing it entirely?”
“Is deleting a file token permanent?”
Tell an agent destructive · confirm first
Delete token {tokenId}.
Remove file token {tokenId} so the shared link no longer works.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/appwrite:appwrite-tokens-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

appwrite-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 2.0.0
  title: Appwrite Tokens API
  description: Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to https://appwrite.io/docs
  termsOfService: https://appwrite.io/policy/terms
  contact:
    name: Appwrite Team
    url: https://appwrite.io/support
    email: team@appwrite.io
  license:
    name: BSD-3-Clause
    url: https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE
servers:
- url: https://cloud.appwrite.io/v1
  description: Appwrite Cloud endpoint.
- url: https://{region}.cloud.appwrite.io/v1
  description: Appwrite Cloud regional endpoint. Replace `{region}` with your project region.
  variables:
    region:
      default: fra
      description: Appwrite Cloud region.
tags:
- name: Tokens
  description: The Tokens service allows you to create and manage resource tokens for secure file access.
paths:
  /tokens/buckets/{bucketId}/files/{fileId}:
    get:
      summary: List tokens
      operationId: tokensList
      tags:
      - Tokens
      description: List all the tokens created for a specific file or bucket. You can use the query params to filter your results.
      responses:
        '200':
          description: Resource Tokens List
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/resourceTokenList'
      deprecated: false
      x-appwrite:
        group: files
        demo: tokens/list.md
        rate-limit: 0
        rate-time: 3600
        rate-key: url:{url},ip:{ip}
        scope: tokens.read
        platforms:
        - console
        - server
        packaging: false
        public: true
        auth:
          console:
            Project: []
          server:
            Project: []
            Key: []
      security:
      - Project: []
        Key: []
      parameters:
      - name: bucketId
        description: Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
        required: true
        schema:
          type: string
          example: <BUCKET_ID>
        in: path
      - name: fileId
        description: File unique ID.
        required: true
        schema:
          type: string
          example: <FILE_ID>
        in: path
      - name: queries
        description: 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire'
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
        in: query
      - name: total
        description: When set to false, the total count returned will be 0 and will not be calculated.
        required: false
        schema:
          type: boolean
          example: false
          default: true
        in: query
    post:
      summary: Create file token
      operationId: tokensCreateFileToken
      tags:
      - Tokens
      description: Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.
      responses:
        '201':
          description: ResourceToken
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/resourceToken'
      deprecated: false
      x-appwrite:
        group: files
        demo: tokens/create-file-token.md
        rate-limit: 60
        rate-time: 60
        rate-key: ip:{ip},method:{method},url:{url},userId:{userId}
        scope: tokens.write
        platforms:
        - console
        - server
        packaging: false
        public: true
        auth:
          console:
            Project: []
          server:
            Project: []
            Key: []
      security:
      - Project: []
        Key: []
      parameters:
      - name: bucketId
        description: Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
        required: true
        schema:
          type: string
          example: <BUCKET_ID>
        in: path
      - name: fileId
        description: File unique ID.
        required: true
        schema:
          type: string
          example: <FILE_ID>
        in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                expire:
                  description: Token expiry date
                  type:
                  - string
                  - 'null'
                  example: '2020-10-15T06:38:00.000+00:00'
                  format: datetime
  /tokens/{tokenId}:
    get:
      summary: Get token
      operationId: tokensGet
      tags:
      - Tokens
      description: Get a token by its unique ID.
      responses:
        '200':
          description: ResourceToken
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/resourceToken'
      deprecated: false
      x-appwrite:
        group: tokens
        demo: tokens/get.md
        rate-limit: 0
        rate-time: 3600
        rate-key: url:{url},ip:{ip}
        scope: tokens.read
        platforms:
        - console
        - server
        packaging: false
        public: true
        auth:
          console:
            Project: []
          server:
            Project: []
            Key: []
      security:
      - Project: []
        Key: []
      parameters:
      - name: tokenId
        description: Token ID.
        required: true
        schema:
          type: string
          example: <TOKEN_ID>
        in: path
    patch:
      summary: Update token
      operationId: tokensUpdate
      tags:
      - Tokens
      description: Update a token by its unique ID. Use this endpoint to update a token's expiry date.
      responses:
        '200':
          description: ResourceToken
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/resourceToken'
      deprecated: false
      x-appwrite:
        group: tokens
        demo: tokens/update.md
        rate-limit: 60
        rate-time: 60
        rate-key: ip:{ip},method:{method},url:{url},userId:{userId}
        scope: tokens.write
        platforms:
        - console
        - server
        packaging: false
        public: true
        auth:
          console:
            Project: []
          server:
            Project: []
            Key: []
      security:
      - Project: []
        Key: []
      parameters:
      - name: tokenId
        description: Token unique ID.
        required: true
        schema:
          type: string
          example: <TOKEN_ID>
        in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                expire:
                  description: File token expiry date
                  type:
                  - string
                  - 'null'
                  example: '2020-10-15T06:38:00.000+00:00'
                  format: datetime
    delete:
      summary: Delete token
      operationId: tokensDelete
      tags:
      - Tokens
      description: Delete a token by its unique ID.
      responses:
        '204':
          description: No content
      deprecated: false
      x-appwrite:
        group: tokens
        demo: tokens/delete.md
        rate-limit: 60
        rate-time: 60
        rate-key: ip:{ip},method:{method},url:{url},userId:{userId}
        scope: tokens.write
        platforms:
        - console
        - server
        packaging: false
        public: true
        auth:
          console:
            Project: []
          server:
            Project: []
            Key: []
      security:
      - Project: []
        Key: []
      parameters:
      - name: tokenId
        description: Token ID.
        required: true
        schema:
          type: string
          example: <TOKEN_ID>
        in: path
components:
  schemas:
    resourceToken:
      description: ResourceToken
      type: object
      properties:
        $id:
          type: string
          description: Token ID.
          example: bb8ea5c16897e
        $createdAt:
          type: string
          description: Token creation date in ISO 8601 format.
          example: '2020-10-15T06:38:00.000+00:00'
        resourceId:
          type: string
          description: Resource ID.
          example: 5e5ea5c168bb8:5e5ea5c168bb8
        resourceType:
          type: string
          description: Resource type.
          example: files
        expire:
          type: string
          description: Token expiration date in ISO 8601 format.
          example: '2020-10-15T06:38:00.000+00:00'
        secret:
          type: string
          description: JWT encoded string.
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
        accessedAt:
          type: string
          description: Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
          example: '2020-10-15T06:38:00.000+00:00'
      required:
      - $id
      - $createdAt
      - resourceId
      - resourceType
      - expire
      - secret
      - accessedAt
      example:
        $id: bb8ea5c16897e
        $createdAt: '2020-10-15T06:38:00.000+00:00'
        resourceId: 5e5ea5c168bb8:5e5ea5c168bb8
        resourceType: files
        expire: '2020-10-15T06:38:00.000+00:00'
        secret: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
        accessedAt: '2020-10-15T06:38:00.000+00:00'
    resourceTokenList:
      description: Resource Tokens List
      type: object
      properties:
        total:
          type: integer
          description: Total number of tokens that matched your query.
          format: int32
          example: 5
        tokens:
          type: array
          description: List of tokens.
          items:
            $ref: '#/components/schemas/resourceToken'
          example: []
      required:
      - total
      - tokens
      example:
        total: 5
        tokens: ''
  securitySchemes:
    Project:
      type: apiKey
      name: X-Appwrite-Project
      description: Your project ID
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
        demo: <YOUR_PROJECT_ID>
    ProjectPath:
      type: apiKey
      name: project
      description: Your project ID
      in: query
      x-appwrite:
        location: path
        param: project_id
        platforms:
        - client
        - server
        - console
        demo: <YOUR_PROJECT_ID>
    JWT:
      type: apiKey
      name: X-Appwrite-JWT
      description: Your secret JSON Web Token
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
        demo: <YOUR_JWT>
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: The OAuth access token to authenticate with
      x-appwrite:
        platforms:
        - client
        - server
        - console
    Locale:
      type: apiKey
      name: X-Appwrite-Locale
      description: ''
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
        demo: en
    Session:
      type: apiKey
      name: X-Appwrite-Session
      description: The user session to authenticate with
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
    DevKey:
      type: apiKey
      name: X-Appwrite-Dev-Key
      description: Your secret dev API key
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
    Cookie:
      type: apiKey
      name: Cookie
      description: The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes.
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
    ImpersonateUserId:
      type: apiKey
      name: X-Appwrite-Impersonate-User-Id
      description: Impersonate a user by ID
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
    ImpersonateUserEmail:
      type: apiKey
      name: X-Appwrite-Impersonate-User-Email
      description: Impersonate a user by email
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
    ImpersonateUserPhone:
      type: apiKey
      name: X-Appwrite-Impersonate-User-Phone
      description: Impersonate a user by phone
      in: header
      x-appwrite:
        platforms:
        - client
        - server
        - console
    Key:
      type: apiKey
      name: X-Appwrite-Key
      description: Your secret API key
      in: header
      x-appwrite:
        platforms:
        - server
        - console
        - manager
        demo: <YOUR_API_KEY>
    Organization:
      type: apiKey
      name: X-Appwrite-Organization
      description: Your organization ID
      in: header
      x-appwrite:
        platforms:
        - server
        - console
        demo: <YOUR_ORGANIZATION_ID>
    ForwardedUserAgent:
      type: apiKey
      name: X-Forwarded-User-Agent
      description: The user agent string of the client that made the request
      in: header
      x-appwrite:
        platforms:
        - server
    Mode:
      type: apiKey
      name: X-Appwrite-Mode
      description: ''
      in: header
      x-appwrite:
        platforms:
        - console
        demo: ''
    Platform:
      type: apiKey
      name: X-Appwrite-Platform
      description: The platform type (Appwrite or Imagine)
      in: header
      x-appwrite:
        platforms:
        - console
externalDocs:
  description: Full API docs, specs and tutorials
  url: https://appwrite.io/docs