> Call POST /v1/check before a tool that writes. DENY means do not invoke the tool. For clean Markdown of any page, append .md to the page URL. For the complete index, fetch https://docs.withwrit.com/llms.txt.

# Sponsor allows one verb once

POST https://api.withwrit.com/v1/grants
Content-Type: application/json

**Sponsor token** (`writ_sp_...`) required — not the API key. The
human sponsor approves a single write: the grant is scoped to the
sponsor's tenant and matches only checks from that tenant's keys on
all five fields (sponsor, agent, verb, target, purpose). Grants are
**single-use**: the first matching check spends the grant; a second
identical check needs a new grant. `ttlSeconds` defaults to 90 and
must be between 1 and 3600. This is the approval behind every
STEP_UP decision — the agent stops, the sponsor grants, the agent
re-checks.


Reference: https://docs.withwrit.com/api-reference/grants-and-approvals/sponsor-allows-one-verb-once

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.withwrit.com` (Writ gate, default)
- `https://j72ckh66ukck2kcbq3oiwxaalm0olxwb.lambda-url.us-east-1.on.aws` (Direct Lambda Function URL (fallback))

## Request

### Headers

- `Authorization` (string, required) — Bearer \<sponsor token> — the writ\_sp\_... token issued with the tenant's first API key.

### Body (application/json)

This endpoint expects an any.

- `any`

## Response

### 201

Grant created. It is live until spent or until `expiresAt`.

## Errors

### 400 Bad Request Error

Missing required fields, or ttlSeconds is not an integer between 1 and 3600.

### 401 Unauthorized Error

Sponsor token required — missing or unknown token. API keys are not accepted here.

## Examples

**Response**

```json
{
  "expiresAt": 1759000300,
  "grantId": "grnt_1a2b3c4d5e6f",
  "target": "order #88412",
  "tenantId": "ten_3fa8b91c2d44",
  "ttlSeconds": 300,
  "verb": "refund"
}
```

**SDK Code**

```python Grants and approvals_sponsorAllowsOneVerbOnce_example
import requests

url = "https://api.withwrit.com/v1/grants"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Grants and approvals_sponsorAllowsOneVerbOnce_example
const url = 'https://api.withwrit.com/v1/grants';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Grants and approvals_sponsorAllowsOneVerbOnce_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.withwrit.com/v1/grants"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Grants and approvals_sponsorAllowsOneVerbOnce_example
require 'uri'
require 'net/http'

url = URI("https://api.withwrit.com/v1/grants")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Grants and approvals_sponsorAllowsOneVerbOnce_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.withwrit.com/v1/grants")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Grants and approvals_sponsorAllowsOneVerbOnce_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.withwrit.com/v1/grants', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Grants and approvals_sponsorAllowsOneVerbOnce_example
using RestSharp;

var client = new RestClient("https://api.withwrit.com/v1/grants");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Grants and approvals_sponsorAllowsOneVerbOnce_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withwrit.com/v1/grants")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```