---
title: "publishRepoExtensionEvent"
---

> Documentation Index
> Fetch the complete documentation index at: https://buildrforge.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# publishRepoExtensionEvent

Path: Forge API › events

`POST /repos/{repo_id}/extensions/{extension_name}/events`

Publish an extension's event, {"name":"…","data":…,"branch"?:"…"}, as type ext.<extension>.<name>, for every stream and room that follows it.

## Path parameters

- `repo_id` (`publishRepoExtensionEvent.path.repo_id`; string, required)
  - pattern: `^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `extension_name` (`publishRepoExtensionEvent.path.extension_name`; string, required)
  - maxLength: `129` · pattern: `^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$`

## Request body

_Required._

- `name` (`publishRepoExtensionEvent.name`; string, required)
  - pattern: `^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$`
- `data` (`publishRepoExtensionEvent.data`; unknown, required)
- `branch` (`publishRepoExtensionEvent.branch`; string, optional)
  - minLength: `1`

## Example request

```json
{
  "name": "string",
  "data": null,
  "branch": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/repos/<repo_id>/extensions/<extension_name>/events' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "data": null,
  "branch": "string"
}
'
```

### TypeScript

```typescript
const url = '<base-url>/repos/<repo_id>/extensions/<extension_name>/events';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({name: 'string', data: null, branch: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/repos/<repo_id>/extensions/<extension_name>/events"

payload = {
    "name": "string",
    "data": None,
    "branch": "string"
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

## Responses

### 201

RepoEvent

#### Example

```json
{
  "seq": -9007199254740991,
  "topic": "string",
  "type": "string",
  "payload": null,
  "actor_id": "string",
  "created_at": "string"
}
```

- `seq` (`publishRepoExtensionEvent.response.201.seq`; integer, required)
  - maximum: `9007199254740991` · minimum: `-9007199254740991`
- `topic` (`publishRepoExtensionEvent.response.201.topic`; string, required)
- `type` (`publishRepoExtensionEvent.response.201.type`; string, required)
- `payload` (`publishRepoExtensionEvent.response.201.payload`; unknown, required)
- `actor_id` (`publishRepoExtensionEvent.response.201.actor_id`; any of, required)
  - any of the following: `string`, `null`
- `created_at` (`publishRepoExtensionEvent.response.201.created_at`; string, required)

### 400

InvalidRequest | RequestBodyTooDeep

#### Example

```json
{
  "_tag": "InvalidRequest",
  "part": "path",
  "issues": [
    {
      "path": [
        "string"
      ],
      "message": "string"
    }
  ]
}
```

Any of the following:

- `InvalidRequestEncoded`
  - `_tag` (`InvalidRequestEncoded._tag`; string, required)
    - one of `"InvalidRequest"`
  - `part` (`InvalidRequestEncoded.part`; string, required)
    - one of `"path"`, `"query"`, `"headers"`, `"body"`
  - `issues` (`InvalidRequestEncoded.issues`; array of object, required)
    - `path` (`InvalidRequestEncoded.issues.path`; array\<any of\>, required)
      - any of the following: `string`, `integer`
    - `message` (`InvalidRequestEncoded.issues.message`; string, required)
- `RequestBodyTooDeepEncoded`
  - `_tag` (`RequestBodyTooDeepEncoded._tag`; string, required)
    - one of `"RequestBodyTooDeep"`
  - `max_depth` (`RequestBodyTooDeepEncoded.max_depth`; integer, required)
    - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 401

InvalidCredentials

#### Example

```json
{
  "_tag": "InvalidCredentials"
}
```

- `_tag` (`publishRepoExtensionEvent.response.401._tag`; string, required)
  - one of `"InvalidCredentials"`

### 403

Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired

#### Example

```json
{
  "_tag": "Forbidden",
  "message": "string"
}
```

Any of the following:

- `ForbiddenEncoded`
  - `_tag` (`ForbiddenEncoded._tag`; string, required)
    - one of `"Forbidden"`
  - `message` (`ForbiddenEncoded.message`; string, required)
- `ForbiddenOriginEncoded`
  - `_tag` (`ForbiddenOriginEncoded._tag`; string, required)
    - one of `"ForbiddenOrigin"`
- `RequiresPersonalSessionEncoded`
  - `_tag` (`RequiresPersonalSessionEncoded._tag`; string, required)
    - one of `"RequiresPersonalSession"`
- `RunBranchRequiredEncoded`
  - `_tag` (`RunBranchRequiredEncoded._tag`; string, required)
    - one of `"RunBranchRequired"`
  - `branch` (`RunBranchRequiredEncoded.branch`; string, required)
    - minLength: `1`
  - `message` (`RunBranchRequiredEncoded.message`; string, required)

### 404

RepoNotFound

#### Example

```json
{
  "_tag": "RepoNotFound"
}
```

- `_tag` (`publishRepoExtensionEvent.response.404._tag`; string, required)
  - one of `"RepoNotFound"`

### 409

RepoArchived

#### Example

```json
{
  "_tag": "RepoArchived"
}
```

- `_tag` (`publishRepoExtensionEvent.response.409._tag`; string, required)
  - one of `"RepoArchived"`

### 413

WriteTooLarge | RequestBodyTooLarge

#### Example

```json
{
  "_tag": "WriteTooLarge",
  "message": "string"
}
```

Any of the following:

- `WriteTooLargeEncoded`
  - `_tag` (`WriteTooLargeEncoded._tag`; string, required)
    - one of `"WriteTooLarge"`
  - `message` (`WriteTooLargeEncoded.message`; string, required)
- `RequestBodyTooLargeEncoded`
  - `_tag` (`RequestBodyTooLargeEncoded._tag`; string, required)
    - one of `"RequestBodyTooLarge"`
  - `max_bytes` (`RequestBodyTooLargeEncoded.max_bytes`; integer, required)
    - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 429

RateLimited

#### Example

```json
{
  "_tag": "RateLimited"
}
```

- `_tag` (`publishRepoExtensionEvent.response.429._tag`; string, required)
  - one of `"RateLimited"`

### 500

RepoFailure

#### Example

```json
{
  "_tag": "RepoFailure",
  "reason": "string"
}
```

- `_tag` (`publishRepoExtensionEvent.response.500._tag`; string, required)
  - one of `"RepoFailure"`
- `reason` (`publishRepoExtensionEvent.response.500.reason`; string, required)

### 503

RepoBusy | SessionUnavailable | RateLimitUnavailable

#### Example

```json
{
  "_tag": "RepoBusy",
  "message": "string"
}
```

Any of the following:

- `RepoBusyEncoded`
  - `_tag` (`RepoBusyEncoded._tag`; string, required)
    - one of `"RepoBusy"`
  - `message` (`RepoBusyEncoded.message`; string, required)
- `SessionUnavailableEncoded`
  - `_tag` (`SessionUnavailableEncoded._tag`; string, required)
    - one of `"SessionUnavailable"`
- `RateLimitUnavailableEncoded`
  - `_tag` (`RateLimitUnavailableEncoded._tag`; string, required)
    - one of `"RateLimitUnavailable"`


Source: https://buildrforge.com/docs/api/publish-repo-extension-event/index.md
