---
title: "Grant a user or team Use, Contribute, or Manage on a resource in the organization this request is bound to, or pass a..."
method: POST
path: "/v1/access/grants"
tags: ["account"]
---

# Grant a user or team Use, Contribute, or Manage on a resource in the organization this request is bound to, or pass a...

`POST /v1/access/grants`

## Request

- Base URL: `https://api.kody.codes`
- URL: `https://api.kody.codes/v1/access/grants`
- Auth: HTTP bearer

Grant a user or team Use, Contribute, or Manage on a resource in the organization this request is bound to, or pass an explicit permission list instead of a preset. Secrets, integrations, MCP servers, and vault bindings use resource_type credential with the credential_id from secretList, integrationList, mcpServerList, or secretProviderList; the grant follows the credential, not its name. resource_type secret or integration with a name still works: the name resolves to its credential once, when the grant is made. Organization grants use resource_type org and this organization id. You need manage access on that resource (or member:write for an organization grant). Only an Owner can put org:write, org:delete, member:write, or member:delete on an organization grant.

Org permission: none (touches no org data).

## Request body

- object
  - `resource_type` 'package' | 'app' | 'job' | 'credential' | 'memory' | 'email' | 'org' | 'secret' | 'integration', required: package, app, job, credential, memory, email, or org. secret or integration take a name instead of a credential id.
  - `resource_id` string, required
  - `subject_type` 'user' | 'team', required
  - `subject_id` string: Person id or team id. Omit when passing username or team_slug.
  - `username` string
  - `team_slug` string
  - `preset` 'use' | 'contribute' | 'manage'
  - `permissions` string[]: Advanced grant. Do not combine with preset.

## Response `200`

Success.

- object
  - `grant` object, required
    - `id` string, required
    - `resource_type` 'package' | 'app' | 'job' | 'credential' | 'memory' | 'email' | 'org', required
    - `resource_id` string, required
    - `subject_type` 'user' | 'team', required
    - `subject_id` string, required
    - `preset` 'use' | 'contribute' | 'manage', nullable, required
    - `permissions` string[], required

## Other responses

- `400`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `401`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `403`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `404`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `409`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `413`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `429`: Too many requests (edge IP/token limit) or an entitlement / plan-cap limit. Wait at least `Retry-After` seconds before retrying.
- `500`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `503`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `default`: Error envelope `{ "error": { "code", "message", "details"? } }`.

---

[API](https://skmtc.dev/kody/apis/kody-api.md) · [All operations](https://skmtc.dev/kody/apis/kody-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kody/apis/kody-api/revisions/a020ecedb82b?raw)
