# org.tangled.repo.mintToken

> Published by [tangled.org](https://lexicon.garden/identity/did:plc:wshs7t2adsemcrrd4snkeqli)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.repo.mintToken)
- [Documentation](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.repo.mintToken/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.repo.mintToken/examples)

## Definitions

### `org.tangled.repo.mintToken`

**Type**: `procedure`

Mint a service-auth JWT whose issuer is this repo's DID, signed by the knot that owns the repo's signing key. When calling this, you'll need the same perms as git push, ie. being repo owner/collaborator/knot-admin.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `aud` | `string` (did) | Yes | Audience of the minted token, a DID service ref for the service, that the token is addressed to. |
| `exp` | `integer` (int64) | Yes | Unix seconds. Must be in the future, and at most 60s after mint time. |
| `lxm` | `string` (nsid) | Yes | Lexicon method to which minted token binds. |
| `repo` | `string` (did) | Yes | DID of the repo that becomes the token's issuer. Must be the audience of a given calling session. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `token` | `string` | Yes | The signed service-auth JWT. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Mint a service-auth JWT whose issuer is this repo's DID, signed by the knot that owns the repo's signing key. When calling this, you'll need the same perms as git push, ie. being repo owner/collaborator/knot-admin.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "aud": {
              "description": "Audience of the minted token, a DID service ref for the service, that the token is addressed to.",
              "format": "did",
              "type": "string"
            },
            "exp": {
              "description": "Unix seconds. Must be in the future, and at most 60s after mint time.",
              "format": "int64",
              "type": "integer"
            },
            "lxm": {
              "description": "Lexicon method to which minted token binds.",
              "format": "nsid",
              "type": "string"
            },
            "repo": {
              "description": "DID of the repo that becomes the token's issuer. Must be the audience of a given calling session.",
              "format": "did",
              "type": "string"
            }
          },
          "required": [
            "repo",
            "aud",
            "lxm",
            "exp"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "token": {
              "description": "The signed service-auth JWT.",
              "type": "string"
            }
          },
          "required": [
            "token"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "org.tangled.repo.mintToken",
  "lexicon": 1
}
```
