# Get Custody Trust

`GET /vault/custody-trust` · Keys & Secrets · Custody & Exit

Returns the values your key's trust policy must name before kibo can use the key: the AWS principal kibo calls from and the external id it sends, and the issuer and subject of the identity kibo federates as. Read them before you grant kibo access to a BYOK key. Needs `PROJECT_ADMIN`.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `projectId` | query | yes | The project's id. Example: `"3f2c9a4e-8b1d-4c6f-9e2a-7d5b1c0a4e8f"`. |

## Responses

- **200**: The values your trust policy names.

| Field | Type | Required | Description |
|---|---|---|---|
| `awsPrincipal` | string \| null | no | AWS: the principal the role's trust names. Absent until this deployment has one. Example: `"arn:aws:iam::444455556666:role/kibo-custody"`. |
| `externalId` | string | yes | AWS: the role's trust requires this as `sts:ExternalId`. Fixed for the project. Example: `"k9o-mfrggzdfmztwq2lknnwg23tpobyxe43uov3ho6dzpiyx2mzqgu4a"`. |
| `tenantIssuer` | string \| null | no | GCP and Azure: the token issuer to trust. Absent until this deployment has one. Example: `"https://kibo.de01.k9o.example/tenant"`. |
| `tenantSubject` | string | yes | GCP and Azure: the only subject to accept. Example: `"k9o:project:3f2b8c1e-5d4a-4e6f-9a7b-1c2d3e4f5a6b"`. |


## Errors

| HTTP | Description |
|---|---|
| 403 | The caller isn't a `PROJECT_ADMIN` of the project. |
| 404 | No such project. |
| 410 | The project's keys were destroyed. |

## Code samples

### cURL

```bash
curl -X GET 'https://<org>.api-<region>.k9o.io/@storefront/vault/custody-trust' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/vault/custody-trust', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### k9o CLI

```bash
k9o custody trust
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.custody.trust()
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.custody.trust()
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.Custody.Trust(ctx)
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.custody().trust().await?;
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.custody().trust()
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.Custody.TrustAsync()
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.custody.trust()
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->custody->trust()
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/keys-secrets/get-custody-trust
