---
title: "Create a 24-hour repository token grant (member)"
method: POST
path: "/orgs/{org_id}/integrations/github/grants"
tags: ["Organizations"]
---

# Create a 24-hour repository token grant (member)

`POST /orgs/{org_id}/integrations/github/grants`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/orgs/{org_id}/integrations/github/grants`
- Auth: HTTP bearer

Binds (org, user, repository, session, cell) for 24 hours and mints the first 1-hour installation token narrowed to that one repository with `contents:write, pull_requests:write, metadata:read`, plus `issues:write` when the installation has accepted that permission (the GitHub App declares it; each installation must re-accept before it is requested). The set actually requested is returned as `permissions`. No token is persisted.

## Path parameters

- `org_id` string, required

## Request body

- object
  - `repository_id` integer, required
  - `session_ref` string, required
  - `cell` string, required

## Response `201`

Grant created; first token attached

- object
  - `grant_id` string, uuid, required
  - `expires_at` string, date-time, required
  - `repository_id` integer, required
  - `repository_full_name` string
  - `installation_id` integer
  - `token` string, required: First 1-hour installation token. Never persisted.
  - `token_expires_at` string, date-time, required
  - `permissions` object, required: The permission set the token was minted with: `contents`, `pull_requests`, `metadata`, plus `issues` when the installation has accepted `issues:write`.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `423`: GitHub installation is suspended
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.
- `502`: An upstream dependency returned an invalid response.
- `503`: An upstream dependency is currently unavailable. The request was not processed; retry after the cooldown window.

---

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