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

# Create AceDataCloud Platform API Credentials

> Platform integration guide - Ace Data Cloud

Create business API credentials for an Application. The creation response may contain a Token that can directly call `https://api.acedata.cloud/**`, or a username/password for Proxy-type credentials; they must be treated as secrets.

## Preparation

1. Create an [Account Token](https://platform.acedata.cloud/documents/platform-token).
2. Obtain the `application_id` that you own from the [Application list](https://platform.acedata.cloud/documents/platform-application-list).

```shell theme={null}
export PLATFORM_TOKEN='your account token'
export APPLICATION_ID='your Application ID'
```

## API Overview

| Item | Content |
| - | - |
| Method | `POST` |
| URL | `https://platform.acedata.cloud/api/v1/credentials/` |
| Auth | Account Token, OAuth token requires `credentials:write` |
| Body | JSON |

## Request Body

| Field | Type | Required | Description |
| - | - | - | - |
| `application_id` | UUID | Yes | Target Application |
| `name` | string | No | Credential display name |
| `limited_amount` | number / null | No | Usage limit per credential; `null` means no independent limit |
| `expired_at` | datetime / null | No | ISO 8601 expiration time |
| `allowed_api_ids` | UUID\[] / null | No | Only allow calling these APIs; an empty array is normalized to no restriction |
| `host` | string | No | Credential host information |
| `for_user_id` | string | No | Used when the Application owner issues delegated credentials for another user |
| `tags` / `metadata` | array / object | No | Custom extension data |

```shell theme={null}
curl -X POST 'https://platform.acedata.cloud/api/v1/credentials/' \
  -H "Authorization: Bearer ${PLATFORM_TOKEN}" \
  -H 'Content-Type: application/json' \
  -d "{\"application_id\":\"${APPLICATION_ID}\",\"name\":\"production\",\"limited_amount\":50}"
```

## Response Description

A successful response returns `201` and a Credential object:

* API/Agent-type services usually return `type=Token` and `token`;
* Proxy-type services usually return `type=Identity` and `username` / `password`, and a Proxy Application allows only one credential;
* `id`, `user_id`, `creator_id`, `used_amount`, and time fields are generated by the server.

The current list and detail APIs also return credentials in plaintext, but clients should not rely on this historical behavior. Save them immediately after creation and avoid writing the response to logs; future APIs may return masked values.

## Error Handling

* `400`: Invalid field format, unknown `allowed_api_ids`, the Proxy Application already has credentials, or other creation constraints.
* `401`: Invalid Account Token.
* `403/404`: No permission to access the target Application, or the Application/delegated user does not exist.

## Next Steps

* [Get API Credential List](https://platform.acedata.cloud/documents/platform-credential-list)
* [Rotate API Credentials](https://platform.acedata.cloud/documents/platform-credential-rotate)
* [Delete API Credentials](https://platform.acedata.cloud/documents/platform-credential-delete)
* [View Usage Records](https://platform.acedata.cloud/documents/platform-usage-list)


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