# Create grant (/en/docs/api/native/application/createGrant)



`POST /application/v1/workers/{worker_id}/grants`

Let this Worker's platform token access one of your databases, folders or knowledge bases.

**Support: supported**

## Parameters [#parameters]

| Name       | Location | Type   | Required | Description         |
| ---------- | -------- | ------ | -------- | ------------------- |
| worker\_id | path     | string | true     | Worker ID (wkr\_…). |

## Request body (application/json) [#request-body-applicationjson]

Required: true

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| resource      | object | Resource to grant.           |
| resource.type | string | Resource type.               |
| resource.id   | string | Resource ID in your account. |
| access        | string | Access level.                |

```json
{
  "type": "object",
  "required": [
    "resource",
    "access"
  ],
  "properties": {
    "resource": {
      "type": "object",
      "description": "Resource to grant.",
      "required": [
        "type",
        "id"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Resource type.",
          "enum": [
            "database",
            "folder",
            "knowledge"
          ],
          "x-enum-descriptions": {
            "database": "A database.",
            "folder": "A file folder.",
            "knowledge": "A knowledge base."
          },
          "example": "database"
        },
        "id": {
          "type": "string",
          "description": "Resource ID in your account.",
          "example": "db_01example"
        }
      }
    },
    "access": {
      "type": "string",
      "description": "Access level.",
      "enum": [
        "read",
        "read_write"
      ],
      "x-enum-descriptions": {
        "read": "Read only.",
        "read_write": "Read and write."
      },
      "example": "read"
    }
  }
}
```

## Response [#response]

### HTTP 200 [#http-200]

Success

**application/json**

| Name | Type | Description |
| --- | --- | --- |
| id | string | Grant ID, prefixed grt_. |
| worker_id | string | Owning Worker. |
| resource | object | Granted resource. |
| resource.type | string | Resource type. |
| resource.id | string | Resource ID. |
| access | string | Access level. |
| created_on | string | When the grant was created. |
