API: Types

Linked Properties

Link Description Type Constraints Supported operations
self This type Type not null READ

Local Properties

Property Description Type Constraints Supported operations
id Type id Integer x > 0 READ
name Type name String   READ
color The color used to represent this type Color   READ
position Sort index of the type Integer   READ
isDefault   Boolean   READ
isMilestone Do tickets of this type represent a milestone? Boolean   READ
createdAt Time of creation DateTime   READ
updatedAt Time of the most recent change to the user DateTime   READ

Methods

List types available in a project

This endpoint lists the types that are available in a given project.

id
integer

required path

ID of the project whose types will be listed

Example:
1

200

OK

{
  "_embedded": {
    "elements": [
      {
        "_links": {
          "self": {
            "href": "/api/v3/types/1"
          }
        },
        "_type": "Type",
        "color": "#ff0000",
        "createdAt": "2014-05-21T08:51:20Z",
        "id": 1,
        "isDefault": true,
        "isMilestone": false,
        "name": "Bug",
        "position": 1,
        "updatedAt": "2014-05-21T08:51:20Z"
      },
      {
        "_links": {
          "self": {
            "href": "/api/v3/types/2"
          }
        },
        "_type": "Type",
        "color": "#888",
        "createdAt": "2014-05-21T08:51:20Z",
        "id": 2,
        "isDefault": false,
        "isMilestone": false,
        "name": "Feature",
        "position": 2,
        "updatedAt": "2014-05-21T08:51:20Z"
      }
    ]
  },
  "_links": {
    "self": {
      "href": "/api/v3/projects/11/types"
    }
  },
  "_type": "Collection",
  "count": 2,
  "total": 2
}

Types_by_ProjectModel

{
  "type": "object",
  "example": {
    "_links": {
      "self": {
        "href": "/api/v3/projects/11/types"
      }
    },
    "total": 2,
    "count": 2,
    "_type": "Collection",
    "_embedded": {
      "elements": [
        {
          "_links": {
            "self": {
              "href": "/api/v3/types/1"
            }
          },
          "_type": "Type",
          "id": 1,
          "name": "Bug",
          "color": "#ff0000",
          "position": 1,
          "isDefault": true,
          "isMilestone": false,
          "createdAt": "2014-05-21T08:51:20Z",
          "updatedAt": "2014-05-21T08:51:20Z"
        },
        {
          "_links": {
            "self": {
              "href": "/api/v3/types/2"
            }
          },
          "_type": "Type",
          "id": 2,
          "name": "Feature",
          "color": "#888",
          "position": 2,
          "isDefault": false,
          "isMilestone": false,
          "createdAt": "2014-05-21T08:51:20Z",
          "updatedAt": "2014-05-21T08:51:20Z"
        }
      ]
    }
  }
}

404

Returned if the project does not exist or the client does not have sufficient permissions to see it.

Required permission: view work packages or manage types (on given project)

Note: A client without sufficient permissions shall not be able to test for the existence of a project. That’s why a 404 is returned here, even if a 403 might be more appropriate.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:NotFound",
  "message": "The specified project does not exist."
}

List all types

No parameters

200

OK

{
  "_embedded": {
    "elements": [
      {
        "_links": {
          "self": {
            "href": "/api/v3/types/1"
          }
        },
        "_type": "Type",
        "color": "#ff0000",
        "createdAt": "2014-05-21T08:51:20Z",
        "id": 1,
        "isDefault": true,
        "isMilestone": false,
        "name": "Bug",
        "position": 1,
        "updatedAt": "2014-05-21T08:51:20Z"
      },
      {
        "_links": {
          "self": {
            "href": "/api/v3/types/2"
          }
        },
        "_type": "Type",
        "color": "#888",
        "createdAt": "2014-05-21T08:51:20Z",
        "id": 2,
        "isDefault": false,
        "isMilestone": false,
        "name": "Feature",
        "position": 2,
        "updatedAt": "2014-05-21T08:51:20Z"
      }
    ]
  },
  "_links": {
    "self": {
      "href": "/api/v3/types"
    }
  },
  "_type": "Collection",
  "count": 2,
  "total": 2
}

TypesModel

{
  "type": "object",
  "example": {
    "_links": {
      "self": {
        "href": "/api/v3/types"
      }
    },
    "total": 2,
    "count": 2,
    "_type": "Collection",
    "_embedded": {
      "elements": [
        {
          "_links": {
            "self": {
              "href": "/api/v3/types/1"
            }
          },
          "_type": "Type",
          "id": 1,
          "name": "Bug",
          "color": "#ff0000",
          "position": 1,
          "isDefault": true,
          "isMilestone": false,
          "createdAt": "2014-05-21T08:51:20Z",
          "updatedAt": "2014-05-21T08:51:20Z"
        },
        {
          "_links": {
            "self": {
              "href": "/api/v3/types/2"
            }
          },
          "_type": "Type",
          "id": 2,
          "name": "Feature",
          "color": "#888",
          "position": 2,
          "isDefault": false,
          "isMilestone": false,
          "createdAt": "2014-05-21T08:51:20Z",
          "updatedAt": "2014-05-21T08:51:20Z"
        }
      ]
    }
  }
}

403

Returned if the client does not have sufficient permissions.

Required permission: view work package or manage types (on any project)

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
  "message": "You are not allowed to see the types."
}

View type

id
integer

required path

Type id

Example:
1

200

OK

{
  "_links": {
    "self": {
      "href": "/api/v3/types/1"
    }
  },
  "_type": "Type",
  "color": "#ff0000",
  "createdAt": "2014-05-21T08:51:20Z",
  "id": 1,
  "isDefault": true,
  "isMilestone": false,
  "name": "Bug",
  "position": 1,
  "updatedAt": "2014-05-21T08:51:20Z"
}

TypeModel

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Type id",
      "readOnly": true,
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "name": {
      "type": "string",
      "description": "Type name",
      "readOnly": true
    },
    "color": {
      "type": "color",
      "description": "The color used to represent this type",
      "readOnly": true
    },
    "position": {
      "type": "integer",
      "description": "Sort index of the type",
      "readOnly": true
    },
    "isDefault": {
      "type": "boolean",
      "readOnly": true
    },
    "isMilestone": {
      "type": "boolean",
      "description": "Do tickets of this type represent a milestone?",
      "readOnly": true
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of creation",
      "readOnly": true
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of the most recent change to the user"
    },
    "_links": {
      "type": "object",
      "required": [
        "self"
      ],
      "properties": {
        "self": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "This type\n\n**Resource**: Type",
              "readOnly": true
            }
          ]
        }
      }
    }
  },
  "example": {
    "_links": {
      "self": {
        "href": "/api/v3/types/1"
      }
    },
    "_type": "Type",
    "id": 1,
    "name": "Bug",
    "color": "#ff0000",
    "position": 1,
    "isDefault": true,
    "isMilestone": false,
    "createdAt": "2014-05-21T08:51:20Z",
    "updatedAt": "2014-05-21T08:51:20Z"
  }
}

403

Returned if the client does not have sufficient permissions.

Required permission: view work package or manage types (on any project)

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
  "message": "You are not allowed to see this type."
}