# Create record

URL: https://docs.hanzo.ai/docs/openapi/author/post-author-deploys-record

> Records that the caller's org deployed a project built from a source repository, which is the edge that makes an author's work earn royalty.

`POST /v1/author/deploys/record`

> [Author →](https://docs.hanzo.ai/docs/openapi/author) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                 |
| ------------- | ----------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/author/deploys/record` |
| **Method**    | `POST`                                          |
| **Operation** | `post_author_deploys_record`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`          |

Records that the caller's org deployed a project built from a
source repository, which is the edge that makes an author's work earn royalty.

It is deliberately NOT an error for a deploy to attribute to nobody: a project
built from no repository, or from one no author has verified, answers
{"recorded": false, "reason"} so a deploy pipeline can fire this on every deploy
without branching. Attribution resolves per-repository first, then owner-wide, so a
repository with its own claim always earns for its own author.

A deploy of a Hanzo-maintained template attributes to the platform treasury, and a
self-deploy (the author's own org deploying its own repository) is recorded for
provenance but excluded from accrual. The edge is idempotent per
repository+project+org.

Answers 201 when it recorded a new edge and 200 otherwise.

## Request

2 fields, body `application/json` (required).

| Field     | In   | Type   | Required | Description                                                  |
| --------- | ---- | ------ | -------- | ------------------------------------------------------------ |
| `project` | body | string | —        | Project is the deployed project's id.                        |
| `repoUrl` | body | string | —        | RepoURL is the source repository the project was built from. |

## Response

| Status    | Body                | Meaning |
| --------- | ------------------- | ------- |
| `200`     | author.deployRecord | ok      |
| `default` | problem-details     | refused |

`200` body — 6 fields.

| Field       | In   | Type            | Always | Description                                                                                             |
| ----------- | ---- | --------------- | ------ | ------------------------------------------------------------------------------------------------------- |
| `created`   | body | boolean         | —      | Created reports whether this call recorded a new attribution edge (201) or found an existing one (200). |
| `createdAt` | body | integer (int64) | —      | CreatedAt is when the edge was first recorded, in unix seconds.                                         |
| `deployId`  | body | string          | —      | DeployID is the attribution edge's handle.                                                              |
| `reason`    | body | string          | —      | Reason says why nothing was attributed.                                                                 |
| `recorded`  | body | boolean         | —      | Recorded reports whether the deploy was attributed to an author at all.                                 |
| `self`      | body | boolean         | —      | Self reports that the deploying org IS the author's org.                                                |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo author deploys record
```

**SDK**

**.ts**

```ts
import { Configuration, AuthorApi } from 'hanzoai';

const api = new AuthorApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postAuthorDeploysRecord({ project: "<project>", repoUrl: "<repoUrl>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AuthorApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AuthorApi(client).post_author_deploys_record(project="<project>", repo_url="<repoUrl>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AuthorAPI.PostAuthorDeploysRecord(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, author_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = author_api::post_author_deploys_record(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AuthorApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AuthorApi(client).postAuthorDeploysRecord();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/author/deploys/record \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "project": "<project>",
       "repoUrl": "<repoUrl>"
     }'
```

**MCP**

MCP reaches **author** through the `author` tool, which names its 5 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_authors"
         }
       }
     }'
```

---

[Author API](https://docs.hanzo.ai/docs/openapi/author) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
