Issues

GET /issues #

Get issues

Returns issues visible to the effective user. Use project_id to scope the search and filter_id for a built-in or saved filter. Results are paginated; omit select to use the default issue fields. The response includes an ETag; send it in If-None-Match to receive 304 Not Modified when the result has not changed.

Parameters

Name In Type Description
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.
If-None-Match header string ETag returned by a prior issue read. A matching value returns 304 without a response body.
project_id query integer e.g. 1
filter_id query string
page_size query integer
page query integer e.g. 1
select query string e.g. id,summary,description

Responses

  • 200 Success ETag X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
    "string"
  • 304 The requested issue has not changed since the supplied ETag. ETag
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X GET \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues
POST /issues #

Create an issue

When creating an issue, most of the fields other than summary, description and category are typically optional. It is also worth noting that when passing references to enumerations like priority or object references like handler, it is sufficient to pass the id or name.

Parameters

Name In Type Description
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.

Request body required

id integer
summary string
description string
steps_to_reproduce string
additional_information string
project object
name string
category object
name string
handler object
name string
email string
reporter object
name string
email string
status object
id number
name string
label string
resolution object
id number
name string
label string
projection object
id number
name string
label string
eta object
id number
name string
label string
view_state object
id number
name string
label string
priority object
id number
name string
label string
severity object
id number
name string
label string
reproducibility object
id number
name string
label string
version object
name string
fixed_in_version object
name string
target_version object
name string
sticky boolean sticky issues show at the top of the View Issues page.
due_date string · date
date_submitted string · date-time
date_updated string · date-time
os string
os_build string
build string
platform string
profile_id integer
profile object
created_at string · date-time
updated_at string · date-time
attachments object[]
id integer
reporter object
name string
email string
created_at string · date-time
filename string
size integer
content_type string
content string · byte Base64-encoded file content.
relationships object[]
tags object[]
history object[]
notes object[]
id integer
text string
reporter object
name string
email string
view_state object
id number
name string
label string
type string
attr string
created_at string · date-time
updated_at string · date-time
attachments object[]
id integer
reporter object
name string
email string
created_at string · date-time
filename string
size integer
content_type string
content string · byte Base64-encoded file content.
time_tracking object
duration string
files object[]
name string
content string
monitors object[]
name string
email string
files object[]
name string
content string
custom_fields object[]
field object
id number
name string
value string

Responses

  • 201 Resource created successfully X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
    "string"
  • 202 Request accepted for moderation X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X POST \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  -H "Content-Type: application/json" \
  https://yourmantishubname.mantishub.io/api/rest/issues \
  -d '{
    "id": 1,
    "summary": "This is a summary",
    "description": "This is a description.\nIt can be multiline.\n",
    "steps_to_reproduce": "This is steps to reproduce.\nIt can be multiline.\n",
    "additional_information": "This is additional information.\nIt can be multiline.\n",
    "project": {
        "name": "MantisHub"
    },
    "category": {
        "name": "Authn"
    },
    "handler": {
        "name": "John Doe",
        "email": "john@example.com"
    },
    "reporter": {
        "name": "John Doe",
        "email": "john@example.com"
    },
    "status": {
        "id": 1,
        "name": "some-name",
        "label": "Localized Name"
    },
    "resolution": {
        "id": 1,
        "name": "some-name",
        "label": "Localized Name"
    },
    "projection": {
        "id": 1,
        "name": "some-name",
        "label": "Localized Name"
    },
    "eta": {
        "id": 1,
        "name": "some-name",
        "label": "Localized Name"
    },
    "view_state": {
        "id": 10,
        "name": "public",
        "label": "Public"
    },
    "priority": {
        "id": 40,
        "name": "high",
        "label": "High"
    },
    "severity": {
        "id": 60,
        "name": "major",
        "label": "Major"
    },
    "reproducibility": {
        "id": 10,
        "name": "always",
        "label": "Always"
    },
    "version": {
        "name": "MantisHub"
    },
    "fixed_in_version": {
        "name": "MantisHub"
    },
    "target_version": {
        "name": "MantisHub"
    },
    "sticky": true,
    "due_date": "string",
    "date_submitted": "string",
    "date_updated": "string",
    "os": "string",
    "os_build": "string",
    "build": "string",
    "platform": "string",
    "profile_id": 1,
    "profile": [],
    "created_at": "string",
    "updated_at": "string",
    "attachments": [
        {
            "id": 1,
            "reporter": {
                "name": "John Doe",
                "email": "john@example.com"
            },
            "created_at": "string",
            "filename": "string",
            "size": 1,
            "content_type": "string",
            "content": "string"
        }
    ],
    "relationships": [
        []
    ],
    "tags": [
        []
    ],
    "history": [
        []
    ],
    "notes": [
        {
            "id": 1,
            "text": "string",
            "reporter": {
                "name": "John Doe",
                "email": "john@example.com"
            },
            "view_state": {
                "id": 10,
                "name": "public",
                "label": "Public"
            },
            "type": "string",
            "attr": "string",
            "created_at": "string",
            "updated_at": "string",
            "attachments": [
                {
                    "id": 1,
                    "reporter": {
                        "name": "John Doe",
                        "email": "john@example.com"
                    },
                    "created_at": "string",
                    "filename": "string",
                    "size": 1,
                    "content_type": "string",
                    "content": "string"
                }
            ],
            "time_tracking": {
                "duration": "string"
            },
            "files": [
                {
                    "name": "string",
                    "content": "string"
                }
            ]
        }
    ],
    "monitors": [
        {
            "name": "John Doe",
            "email": "john@example.com"
        }
    ],
    "files": [
        {
            "name": "string",
            "content": "string"
        }
    ],
    "custom_fields": [
        {
            "field": {
                "id": 1,
                "name": "string"
            },
            "value": "string"
        }
    ]
}'
Request body · application/json
{
    "id": 1,
    "summary": "This is a summary",
    "description": "This is a description.\nIt can be multiline.\n",
    "steps_to_reproduce": "This is steps to reproduce.\nIt can be multiline.\n",
    "additional_information": "This is additional information.\nIt can be multiline.\n",
    "project": {
        "name": "MantisHub"
    },
    "category": {
        "name": "Authn"
    },
    "handler": {
        "name": "John Doe",
        "email": "john@example.com"
    },
    "reporter": {
        "name": "John Doe",
        "email": "john@example.com"
    },
    "status": {
        "id": 1,
        "name": "some-name",
        "label": "Localized Name"
    },
    "resolution": {
        "id": 1,
        "name": "some-name",
        "label": "Localized Name"
    },
    "projection": {
        "id": 1,
        "name": "some-name",
        "label": "Localized Name"
    },
    "eta": {
        "id": 1,
        "name": "some-name",
        "label": "Localized Name"
    },
    "view_state": {
        "id": 10,
        "name": "public",
        "label": "Public"
    },
    "priority": {
        "id": 40,
        "name": "high",
        "label": "High"
    },
    "severity": {
        "id": 60,
        "name": "major",
        "label": "Major"
    },
    "reproducibility": {
        "id": 10,
        "name": "always",
        "label": "Always"
    },
    "version": {
        "name": "MantisHub"
    },
    "fixed_in_version": {
        "name": "MantisHub"
    },
    "target_version": {
        "name": "MantisHub"
    },
    "sticky": true,
    "due_date": "string",
    "date_submitted": "string",
    "date_updated": "string",
    "os": "string",
    "os_build": "string",
    "build": "string",
    "platform": "string",
    "profile_id": 1,
    "profile": [],
    "created_at": "string",
    "updated_at": "string",
    "attachments": [
        {
            "id": 1,
            "reporter": {
                "name": "John Doe",
                "email": "john@example.com"
            },
            "created_at": "string",
            "filename": "string",
            "size": 1,
            "content_type": "string",
            "content": "string"
        }
    ],
    "relationships": [
        []
    ],
    "tags": [
        []
    ],
    "history": [
        []
    ],
    "notes": [
        {
            "id": 1,
            "text": "string",
            "reporter": {
                "name": "John Doe",
                "email": "john@example.com"
            },
            "view_state": {
                "id": 10,
                "name": "public",
                "label": "Public"
            },
            "type": "string",
            "attr": "string",
            "created_at": "string",
            "updated_at": "string",
            "attachments": [
                {
                    "id": 1,
                    "reporter": {
                        "name": "John Doe",
                        "email": "john@example.com"
                    },
                    "created_at": "string",
                    "filename": "string",
                    "size": 1,
                    "content_type": "string",
                    "content": "string"
                }
            ],
            "time_tracking": {
                "duration": "string"
            },
            "files": [
                {
                    "name": "string",
                    "content": "string"
                }
            ]
        }
    ],
    "monitors": [
        {
            "name": "John Doe",
            "email": "john@example.com"
        }
    ],
    "files": [
        {
            "name": "string",
            "content": "string"
        }
    ],
    "custom_fields": [
        {
            "field": {
                "id": 1,
                "name": "string"
            },
            "value": "string"
        }
    ]
}
DELETE /issues #

Delete issues

Deletes the issues selected by the request's issue parameters.

Parameters

Name In Type Description
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.
id required query integer ID of the issue to delete.

Responses

  • 204 Operation completed successfully with no response body X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X DELETE \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues?id=1
GET /issues/{id} #

Get an issue

Returns one visible issue. The response includes an ETag; use it with If-Match when subsequently updating or deleting the issue.

Parameters

Name In Type Description
id required path integer The issue ID e.g. 123
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.
If-None-Match header string ETag returned by a prior issue read. A matching value returns 304 without a response body.
select query string e.g. id,summary,description

Responses

  • 200 Success ETag X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
    "string"
  • 304 The requested issue has not changed since the supplied ETag. ETag
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X GET \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123
PATCH /issues/{id} #

Update an issue

Applies the supplied fields to an existing issue. For optimistic concurrency, first read the issue and send its ETag in If-Match. A mismatch returns 412 Precondition Failed.

Parameters

Name In Type Description
id required path integer The issue ID e.g. 123
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.
If-Match header string ETag returned by a prior issue read. The operation fails with 412 if it no longer matches.

Request body required

id integer
project object
name string
reporter object
name string
email string
summary string
description string
steps_to_reproduce string
additional_information string
category object
name string
priority object
name string
handler object
name string
status object
name string
severity object
id integer
name string
reproducibility object
id integer
name string
resolution object
id integer
name string
projection object
id integer
name string
eta object
id integer
name string
view_state object
id integer
name string
version object
id integer
name string
fixed_in_version object
id integer
name string
target_version object
id integer
name string
sticky boolean
due_date string · date
date_submitted string · date-time
date_updated string · date-time
profile_id integer
os string
os_build string
build string
platform string
monitors object[]
name string
email string
custom_fields object[]
field object
name string
value string
notes object[]
id number
reporter object
name string
text string
view_state object
id number
name string
label string

Responses

  • 200 Success ETag X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
    "string"
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 412 The supplied If-Match value does not match the current issue ETag. ETag
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X PATCH \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  -H "Content-Type: application/json" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123 \
  -d '{
    "id": 1,
    "project": {
        "name": "MantisHub"
    },
    "reporter": {
        "name": "John Doe",
        "email": "john@example.com"
    },
    "summary": "string",
    "description": "string",
    "steps_to_reproduce": "string",
    "additional_information": "string",
    "category": {
        "name": "Authn"
    },
    "priority": {
        "name": "string"
    },
    "handler": {
        "name": "string"
    },
    "status": {
        "name": "string"
    },
    "severity": {
        "id": 1,
        "name": "string"
    },
    "reproducibility": {
        "id": 1,
        "name": "string"
    },
    "resolution": {
        "id": 1,
        "name": "string"
    },
    "projection": {
        "id": 1,
        "name": "string"
    },
    "eta": {
        "id": 1,
        "name": "string"
    },
    "view_state": {
        "id": 1,
        "name": "string"
    },
    "version": {
        "id": 1,
        "name": "string"
    },
    "fixed_in_version": {
        "id": 1,
        "name": "string"
    },
    "target_version": {
        "id": 1,
        "name": "string"
    },
    "sticky": true,
    "due_date": "string",
    "date_submitted": "string",
    "date_updated": "string",
    "profile_id": 1,
    "os": "string",
    "os_build": "string",
    "build": "string",
    "platform": "string",
    "monitors": [
        {
            "name": "John Doe",
            "email": "john@example.com"
        }
    ],
    "custom_fields": [
        {
            "field": {
                "name": "string"
            },
            "value": "string"
        }
    ],
    "notes": [
        {
            "id": 1,
            "reporter": {
                "name": "string"
            },
            "text": "string",
            "view_state": {
                "id": 1,
                "name": "string",
                "label": "string"
            }
        }
    ]
}'
Request body · application/json
{
    "id": 1,
    "project": {
        "name": "MantisHub"
    },
    "reporter": {
        "name": "John Doe",
        "email": "john@example.com"
    },
    "summary": "string",
    "description": "string",
    "steps_to_reproduce": "string",
    "additional_information": "string",
    "category": {
        "name": "Authn"
    },
    "priority": {
        "name": "string"
    },
    "handler": {
        "name": "string"
    },
    "status": {
        "name": "string"
    },
    "severity": {
        "id": 1,
        "name": "string"
    },
    "reproducibility": {
        "id": 1,
        "name": "string"
    },
    "resolution": {
        "id": 1,
        "name": "string"
    },
    "projection": {
        "id": 1,
        "name": "string"
    },
    "eta": {
        "id": 1,
        "name": "string"
    },
    "view_state": {
        "id": 1,
        "name": "string"
    },
    "version": {
        "id": 1,
        "name": "string"
    },
    "fixed_in_version": {
        "id": 1,
        "name": "string"
    },
    "target_version": {
        "id": 1,
        "name": "string"
    },
    "sticky": true,
    "due_date": "string",
    "date_submitted": "string",
    "date_updated": "string",
    "profile_id": 1,
    "os": "string",
    "os_build": "string",
    "build": "string",
    "platform": "string",
    "monitors": [
        {
            "name": "John Doe",
            "email": "john@example.com"
        }
    ],
    "custom_fields": [
        {
            "field": {
                "name": "string"
            },
            "value": "string"
        }
    ],
    "notes": [
        {
            "id": 1,
            "reporter": {
                "name": "string"
            },
            "text": "string",
            "view_state": {
                "id": 1,
                "name": "string",
                "label": "string"
            }
        }
    ]
}
DELETE /issues/{id} #

Delete an issue

Deletes an issue. Supply the current ETag in If-Match to ensure that the issue was not changed after it was read.

Parameters

Name In Type Description
id required path integer The issue ID e.g. 123
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.
If-Match header string ETag returned by a prior issue read. The operation fails with 412 if it no longer matches.

Responses

  • 204 Operation completed successfully with no response body ETag X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 412 The supplied If-Match value does not match the current issue ETag. ETag
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X DELETE \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123