# Import an issue

> Open an issue from a ticket in Jira or Linear, or from a Sentry issue, by its key or address.

<div class="g1t-endpoint"><span class="g1t-method" data-method="post">POST</span><code>/repos/{owner}/{name}/issues/import</code></div>

The issue is linked to it: agents read the original, and when the work lands the ticket is told. Importing the same ticket again returns the issue already made. With assign, a g1t agent starts on it.

`created` is false when the ticket was imported before; `number` is then that issue.

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`issue`](/reference/mcp/#issue) with `action` `import`, and the same inputs
- **Scope:** An access token needs [`issues:write`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner` | string | Yes | The workspace that owns the repository. |
| `name` | string | Yes | The repository's name. |

## Body parameters

Send a JSON object. Names are `snake_case`, as in responses; the `camelCase` spelling is accepted too.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `reference` | string | Yes | A ticket key such as TECH-1234, or a Jira, Linear or Sentry address. |
| `assign` | boolean | No | Put a g1t agent on the issue. |

## Example request

```sh
curl -X POST https://api.g1t.sh/repos/flagon-io/hello/issues/import \
  -H "Authorization: Bearer $G1T_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "TECH-1234"
  }'
```

## Example response

A successful request answers `200` with:

```json
{
  "number": 42,
  "item": {
    "provider": "jira",
    "key": "TECH-1234",
    "title": "Checkout fails for EU cards",
    "url": "https://acme.atlassian.net/browse/TECH-1234",
    "status": "In Progress",
    "body": "Customers with 3DS cards see a 500 at /pay.",
    "fetched_at": "2026-10-04T15:42:07.318Z"
  },
  "created": true
}
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 409 | `conflict` | The request conflicts with the current state. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
