> ## 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.

# AceDataCloud 플랫폼 API 자격 증명 생성

> Platform API guide - Ace Data Cloud

Application에 대한 비즈니스 API 자격 증명을 생성합니다. 생성 응답에는 `https://api.acedata.cloud/**`를 직접 호출할 수 있는 Token 또는 Proxy 유형 자격 증명의 사용자 이름/비밀번호가 포함될 수 있으므로 반드시 비밀로 취급해야 합니다.

## 준비 작업

1. [Account Token](https://platform.acedata.cloud/documents/platform-token)을 생성합니다.
2. [Application 목록](https://platform.acedata.cloud/documents/platform-application-list)에서 본인이 소유한 `application_id`를 가져옵니다.

```shell theme={null}
export PLATFORM_TOKEN='당신의 계정 토큰'
export APPLICATION_ID='당신의 Application ID'
```

## 인터페이스 개요

| 항목 | 내용 |
| - | - |
| 메서드 | `POST` |
| URL | `https://platform.acedata.cloud/api/v1/credentials/` |
| 인증 | Account Token, OAuth token에는 `credentials:write` 필요 |
| Body | JSON |

## 요청 본문

| 필드 | 유형 | 필수 | 설명 |
| - | - | - | - |
| `application_id` | UUID | 예 | 대상 Application |
| `name` | string | 아니요 | 자격 증명 표시 이름 |
| `limited_amount` | number / null | 아니요 | 단일 자격 증명 사용량 상한; `null`은 독립 상한을 설정하지 않음을 의미 |
| `expired_at` | datetime / null | 아니요 | ISO 8601 만료 시간 |
| `allowed_api_ids` | UUID\[] / null | 아니요 | 이 API들만 호출 허용; 빈 배열은 제한 없음으로 정규화됨 |
| `host` | string | 아니요 | 자격 증명 host 정보 |
| `for_user_id` | string | 아니요 | Application 소유자가 다른 사용자를 위해 권한 자격 증명을 발급할 때 사용 |
| `tags` / `metadata` | array / object | 아니요 | 사용자 정의 확장 데이터 |

```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}"
```

## 응답 설명

성공 시 `201` 및 Credential 객체를 반환합니다:

* API/Agent 유형 서비스는 일반적으로 `type=Token` 및 `token`을 반환합니다;
* Proxy 유형 서비스는 일반적으로 `type=Identity` 및 `username` / `password`를 반환하며, 하나의 Proxy Application은 하나의 자격 증명만 허용합니다;
* `id`, `user_id`, `creator_id`, `used_amount` 및 시간 필드는 서버에서 생성됩니다.

현재 목록 및 상세 인터페이스도 자격 증명 평문을 반환하지만, 클라이언트는 이 과거 동작에 의존해서는 안 됩니다. 생성 후 즉시 저장하고 응답을 로그에 기록하지 마십시오. 향후 인터페이스는 마스킹된 응답으로 변경될 수 있습니다.

## 오류 처리

* `400`: 필드 형식 오류, 알 수 없는 `allowed_api_ids`, Proxy Application에 이미 자격 증명이 존재하거나 기타 생성 제약 조건.
* `401`: Account Token이 유효하지 않음.
* `403/404`: 대상 Application에 접근할 권한이 없거나, Application/권한 부여 사용자가 존재하지 않음.

## 다음 단계

* [API 자격 증명 목록 가져오기](https://platform.acedata.cloud/documents/platform-credential-list)
* [API 자격 증명 교체](https://platform.acedata.cloud/documents/platform-credential-rotate)
* [API 자격 증명 삭제](https://platform.acedata.cloud/documents/platform-credential-delete)
* [호출 기록 보기](https://platform.acedata.cloud/documents/platform-usage-list)


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