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

# Application & Access Tokens API

> Create an application and generate the long-lived API token used to call Silicon Data data APIs.

> 📌 **Note:** These endpoints require an **active subscription**. They are how customers obtain the application token used to authenticate all data APIs.

The typical flow is: log in to obtain a user `id_token`, call **`/api/application/create`** to create an application (which returns a `client_id` and `client_secret`), then call **`/api/application/generate-token`** with those credentials to mint an application token (`app_token`). Use that `app_token` as the Bearer token for the data APIs.

All endpoints below are authenticated with either a user `id_token` or an application `app_token`, and require an active subscription. Successful responses are wrapped in the standard `{ "meta": ..., "data": ... }` envelope.

## <span style={{ color: 'white', fontWeight: 'bold', backgroundColor: '#007BFF', border: '2px solid #007BFF', borderRadius: '5px', padding: '5px', display: 'inline-block' }}>POST</span> /api/application/create

Create a new application for your company. Returns the `client_id` and `client_secret` used to generate tokens. The number of applications you may create is limited by your subscription tier.

### Authorization

**🔒OAuth2**: OAuth2PasswordBearer\
**Flow type**: password\
**Token URL**: token

### Request Body

The request body must be in `application/json` format.

| Field         | Type           | Required | Description             | Constraints              |
| ------------- | -------------- | -------- | ----------------------- | ------------------------ |
| `name`        | string         | Yes      | Application name        | \[ 1 .. 60 ] characters  |
| `description` | string or null | No       | Application description | \[ 1 .. 512 ] characters |

### Request Example

```json theme={null}
{
  "name": "Production Data Pipeline",
  "description": "Pulls daily GPU index data"
}
```

### Responses

* **200**: Successful Response

```json theme={null}
{
  "meta": {
    "code": 0,
    "url": "/api/application/create",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "id": "1858835781410496512",
    "name": "Production Data Pipeline",
    "description": "Pulls daily GPU index data",
    "client_id": "a1b2c3d4e5f6g7h8",
    "client_secret": "s3cr3t-9z8y7x6w5v4u3t2s1r0q",
    "customer_id": "1858835781410496000"
  }
}
```

* **422**: Validation Error

```json theme={null}
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}
```

***

## <span style={{ color: 'white', fontWeight: 'bold', backgroundColor: '#007BFF', border: '2px solid #007BFF', borderRadius: '5px', padding: '5px', display: 'inline-block' }}>POST</span> /api/application/generate-token

Use an application's `client_id` and `client_secret` to generate a temporary application token (`app_token`). This token is the Bearer token used to call the data APIs. The number of valid tokens per application and the token validity period are determined by your subscription tier (default validity is 90 days).

### Authorization

**🔒OAuth2**: OAuth2PasswordBearer\
**Flow type**: password\
**Token URL**: token

### Request Body

The request body must be in `application/json` format.

| Field           | Type   | Required | Description               | Constraints |
| --------------- | ------ | -------- | ------------------------- | ----------- |
| `client_id`     | string | Yes      | Application client id     |             |
| `client_secret` | string | Yes      | Application client secret |             |

### Request Example

```json theme={null}
{
  "client_id": "a1b2c3d4e5f6g7h8",
  "client_secret": "s3cr3t-9z8y7x6w5v4u3t2s1r0q"
}
```

### Responses

* **200**: Successful Response

```json theme={null}
{
  "meta": {
    "code": 0,
    "url": "/api/application/generate-token",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "app_token": "eyJ0eXAiOiJqd3RfYXBwX3Rva2VuIiwiYWxnIjoiSFMyNTYifQ...",
    "token_type": "bearer",
    "expired_time": "2025-07-10T12:31:11+00:00"
  }
}
```

* **422**: Validation Error

```json theme={null}
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}
```

***

## <span style={{ color: 'white', fontWeight: 'bold', backgroundColor: '#28A745', border: '2px solid #28A745', borderRadius: '5px', padding: '5px', display: 'inline-block' }}>GET</span> /api/application/token-info

Get information about the application token used to authenticate the request. Call this endpoint using the `app_token` as the Bearer token.

### Authorization

**🔒OAuth2**: OAuth2PasswordBearer\
**Flow type**: password\
**Token URL**: token

### Responses

* **200**: Successful Response

```json theme={null}
{
  "meta": {
    "code": 0,
    "url": "/api/application/token-info",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "email": "jane.doe@acme.com",
    "client_id": "a1b2c3d4e5f6g7h8",
    "expired_time": "2025-07-10T12:31:11+00:00"
  }
}
```

***

## <span style={{ color: 'white', fontWeight: 'bold', backgroundColor: '#007BFF', border: '2px solid #007BFF', borderRadius: '5px', padding: '5px', display: 'inline-block' }}>POST</span> /api/application/update

Update an application's `name` or `description`. The `client_id` and `client_secret` cannot be modified after creation.

### Authorization

**🔒OAuth2**: OAuth2PasswordBearer\
**Flow type**: password\
**Token URL**: token

### Request Body

The request body must be in `application/json` format.

| Field         | Type           | Required | Description                 | Constraints              |
| ------------- | -------------- | -------- | --------------------------- | ------------------------ |
| `id`          | integer        | Yes      | The application id          |                          |
| `name`        | string or null | No       | New application name        | \[ 1 .. 60 ] characters  |
| `description` | string or null | No       | New application description | \[ 1 .. 512 ] characters |

### Request Example

```json theme={null}
{
  "id": 1858835781410496512,
  "name": "Production Data Pipeline v2",
  "description": "Pulls daily GPU and RAM index data"
}
```

### Responses

* **200**: Successful Response

```json theme={null}
{
  "meta": {
    "code": 0,
    "url": "/api/application/update",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "id": "1858835781410496512",
    "name": "Production Data Pipeline v2",
    "description": "Pulls daily GPU and RAM index data"
  }
}
```

* **422**: Validation Error

```json theme={null}
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}
```

***

## <span style={{ color: 'white', fontWeight: 'bold', backgroundColor: '#007BFF', border: '2px solid #007BFF', borderRadius: '5px', padding: '5px', display: 'inline-block' }}>POST</span> /api/application/info

Get detailed information about a single application, including its tokens. Provide at least one of `id` or `name`.

### Authorization

**🔒OAuth2**: OAuth2PasswordBearer\
**Flow type**: password\
**Token URL**: token

### Request Body

The request body must be in `application/json` format.

| Field  | Type            | Required | Description        | Constraints             |
| ------ | --------------- | -------- | ------------------ | ----------------------- |
| `id`   | integer or null | No\*     | The application id |                         |
| `name` | string or null  | No\*     | Application name   | \[ 1 .. 60 ] characters |

\* At least one of `id` or `name` must be provided.

### Request Example

```json theme={null}
{
  "id": 1858835781410496512
}
```

### Responses

* **200**: Successful Response

```json theme={null}
{
  "meta": {
    "code": 0,
    "url": "/api/application/info",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "id": "1858835781410496512",
    "name": "Production Data Pipeline",
    "description": "Pulls daily GPU index data",
    "client_id": "a1b2c3d4e5f6g7h8",
    "client_secret": "s3cr3t-9z8y7x6w5v4u3t2s1r0q",
    "customer_id": "1858835781410496000",
    "tokens": [
      {
        "id": "1858835900000000000",
        "token": "eyJ0eXAiOiJqd3RfYXBwX3Rva2VuIiwiYWxnIjoiSFMyNTYifQ...",
        "token_type": "Bearer",
        "expired_time": "2025-07-10T12:31:11+00:00",
        "create_date": "2025-04-11T12:31:11+00:00",
        "is_expired": false
      }
    ]
  }
}
```

* **422**: Validation Error

```json theme={null}
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}
```

***

## <span style={{ color: 'white', fontWeight: 'bold', backgroundColor: '#007BFF', border: '2px solid #007BFF', borderRadius: '5px', padding: '5px', display: 'inline-block' }}>POST</span> /api/application/list

List your applications and their tokens. Customers see only their own company's applications. An optional search body can be supplied for filtering, ordering, and pagination.

### Authorization

**🔒OAuth2**: OAuth2PasswordBearer\
**Flow type**: password\
**Token URL**: token

### Request Body

The request body must be in `application/json` format. All fields are optional; send an empty object `{}` to list all of your applications.

| Field      | Type           | Required | Description                                 | Constraints |
| ---------- | -------------- | -------- | ------------------------------------------- | ----------- |
| `filter`   | array or null  | No       | Filter conditions                           |             |
| `order_by` | array or null  | No       | Ordering conditions                         |             |
| `paginate` | object or null | No       | Pagination settings (e.g. page / page size) |             |

### Request Example

```json theme={null}
{}
```

### Responses

* **200**: Successful Response

```json theme={null}
{
  "meta": {
    "code": 0,
    "url": "/api/application/list",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "total": 1,
    "results": [
      {
        "id": "1858835781410496512",
        "name": "Production Data Pipeline",
        "description": "Pulls daily GPU index data",
        "client_id": "a1b2c3d4e5f6g7h8",
        "client_secret": "s3cr3t-9z8y7x6w5v4u3t2s1r0q",
        "customer_id": "1858835781410496000",
        "tokens": [
          {
            "id": "1858835900000000000",
            "token": "eyJ0eXAiOiJqd3RfYXBwX3Rva2VuIiwiYWxnIjoiSFMyNTYifQ...",
            "token_type": "Bearer",
            "expired_time": "2025-07-10T12:31:11+00:00",
            "create_date": "2025-04-11T12:31:11+00:00",
            "is_expired": false
          }
        ]
      }
    ]
  }
}
```

***

## <span style={{ color: 'white', fontWeight: 'bold', backgroundColor: '#DC3545', border: '2px solid #DC3545', borderRadius: '5px', padding: '5px', display: 'inline-block' }}>DELETE</span> /api/application/delete

Delete an application by `id` or `name`. All valid (non-expired) tokens for the application must be removed first. Provide at least one of `id` or `name`.

### Authorization

**🔒OAuth2**: OAuth2PasswordBearer\
**Flow type**: password\
**Token URL**: token

### Request Body

The request body must be in `application/json` format.

| Field  | Type            | Required | Description        | Constraints             |
| ------ | --------------- | -------- | ------------------ | ----------------------- |
| `id`   | integer or null | No\*     | The application id |                         |
| `name` | string or null  | No\*     | Application name   | \[ 1 .. 60 ] characters |

\* At least one of `id` or `name` must be provided.

### Request Example

```json theme={null}
{
  "id": 1858835781410496512
}
```

### Responses

* **200**: Successful Response

```json theme={null}
{
  "meta": {
    "code": 0,
    "url": "/api/application/delete",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": [
    "the record has been deleted succeed"
  ]
}
```

* **422**: Validation Error

```json theme={null}
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}
```
