{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/safetyculture/main/json-schema/safetyculture-s12-tasks-v1-create-incident-request-schema.json", "title": "CreateIncidentRequest represents the parameters to `CreateIncident`", "x-generated": "2026-10-14", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/safetyculture-mitti-api-openapi.yml#/components/schemas/s12.tasks.v1.CreateIncidentRequest", "type": "object", "properties": { "task_id": { "type": "string", "description": "A UUID to identify the issue.\nOptional. If it is not provided, it will be automatically generated." }, "title": { "type": "string", "description": "Required. Title of the issue (maximum 255 characters)." }, "description": { "type": "string", "description": "Optional. Description of the issue (maximum 500 characters)." }, "collaborators": { "type": "array", "items": { "type": "object", "$ref": "#/$defs/s12.tasks.v1.Task.Collaborator" }, "description": "The collaborators involved in this issue.\nCollaborators are users who have been assigned to the issue. The user will\nappear in the \"Assignee\" field in the issue. Only one user can be assigned\nto an issue at a time." }, "created_at": { "type": "string", "format": "date-time", "description": "Optional. The date and time this issue was created.\nIf no date is provided, the current time will be used.\nMust be sent in the Internet Date-Time format, more information about the type is\navailable here:\nhttps://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp." }, "category_id": { "type": "string", "description": "Required. The ID of the issue's category.\nCategories are configured at an organization level, and can be retrieved\nfrom the `GetCategories` endpoint. The issue will not be created if the\ncategory is missing, and an error will be returned." }, "status_id": { "type": "string", "description": "Optional. ID of the issue's status.\nIf not set, this issue will be stored with the default status (Open).\nAn issue can be open, in progress, or resolved, and these are represented\nby hardcoded UUID values. Open status: `547ed646-5e34-4732-bb54-a199d304368a`.\nIn Progress status: `ca6f3bc7-b943-406e-8399-8a713b7e6268`.\nResolved status: `450484b1-56cd-4784-9b49-a3cf97d0c0ad`." }, "site_id": { "type": "string", "description": "The ID of the site associated with the issue.\nSite IDs can be retrieved on platform." }, "location": { "description": "The geographical location of the issue.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.Task.AddressLocation" } ] }, "question_answers": { "type": "array", "items": { "type": "object", "$ref": "#/$defs/s12.tasks.v1.QuestionAnswer" }, "description": "Answers for questions on the issue." }, "items": { "type": "array", "items": { "type": "object", "$ref": "#/$defs/s12.tasks.v1.Item" }, "description": "Optional. The category fields and questions that applied to this incident\nwhen it was created." }, "occurred_at": { "type": "string", "format": "date-time", "description": "Optional. Date and time this incident occurred at" }, "asset_id": { "type": "string", "description": "Optional. The ID of the asset associated with this issue." }, "ai_generated": { "type": "boolean", "description": "The Assistant passes the mitti-ai-marked header on the create call, so a\nnew caller sets it the same way. The field stays for existing callers." } }, "required": [ "title", "category_id" ], "$defs": { "s12.common.GeoPosition": { "type": "object", "properties": { "longitude": { "type": "number", "format": "double", "description": "The geographical longitude" }, "latitude": { "type": "number", "format": "double", "description": "The geographical latitude" }, "accuracy": { "type": "integer", "format": "int32", "description": "The accuracy in meters" } }, "description": "A position is the fundamental geographical geometry construct." }, "s12.tasks.v1.AnswerText": { "type": "object", "properties": { "text": { "type": "string", "description": "The text that answers the question." } }, "description": "A type of answer for a custom question containing text data." }, "s12.tasks.v1.CollaboratorRole": { "type": "string", "enum": [ "ASSIGNEE", "CREATOR" ], "default": "COLLABORATOR_ROLE_NOT_SET", "description": "- ASSIGNEE: The collaborator has been assigned to a task.\n - CREATOR: The collaborator has created the task.", "title": "The role of the collaborator in relation to a task" }, "s12.tasks.v1.CollaboratorType": { "type": "string", "enum": [ "USER", "GROUP", "EXTERNAL_USER", "CONTRIBUTOR" ], "default": "COLLABORATOR_TYPE_NOT_SET", "description": "- USER: The collaborator is an internal user.\n - GROUP: The collaborator is a group.\n - EXTERNAL_USER: The collaborator is an external user.\nThis happens when a task is assigned to an email address.\n - CONTRIBUTOR: The collaborator is a contributor.\nA contributor is an individual who raises a task anonymously. For example,\ncreating an incident through the incident QR code functionality.", "title": "The type of the collaborator" }, "s12.tasks.v1.Item": { "type": "object", "properties": { "id": { "type": "string", "description": "The UUID of the item." }, "name": { "type": "string", "description": "Name of the item" }, "is_mandatory": { "type": "boolean", "description": "Whether or not the item must be filled before submission" }, "type": { "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.Item.ItemType" } ], "description": "Type of item" }, "question_data": { "$ref": "#/$defs/s12.tasks.v1.Question" }, "is_disabled": { "type": "boolean", "description": "Whether or not the item is disabled and hidden from submission" } }, "title": "Item for a given category/incident" }, "s12.tasks.v1.Item.ItemType": { "type": "string", "enum": [ "ITEM_TYPE_UNSPECIFIED", "ITEM_TYPE_TITLE", "ITEM_TYPE_DESCRIPTION", "ITEM_TYPE_SITE", "ITEM_TYPE_MEDIA", "ITEM_TYPE_LOCATION", "ITEM_TYPE_QUESTION", "ITEM_TYPE_OCCURRED_AT", "ITEM_TYPE_ASSET" ], "default": "ITEM_TYPE_UNSPECIFIED", "description": "- ITEM_TYPE_UNSPECIFIED: The item type is unspecified", "title": "The types of items" }, "s12.tasks.v1.MultipleChoiceOption": { "type": "object", "properties": { "id": { "type": "string", "description": "The UUID of the multiple choice option." }, "text": { "type": "string", "description": "The text of the multiple choice option. This does not use the new `validator.string` option as question processing\nlogic fails when symbols are substituted for similar-looking symbols." } }, "description": "MultipleChoiceOption represents a possible answer for a multiple choice question." }, "s12.tasks.v1.MultipleChoiceOptions": { "type": "object", "properties": { "options": { "type": "array", "items": { "type": "object", "$ref": "#/$defs/s12.tasks.v1.MultipleChoiceOption" } } }, "description": "MultipleChoiceOptions is an explicit message for a set of MultipleChoiceOption's to use in a oneof field below." }, "s12.tasks.v1.Question": { "type": "object", "properties": { "id": { "type": "string", "description": "The UUID of the question." }, "text": { "type": "string", "description": "The text of the question being asked (e.g. \"How many eggs are in a dozen?\"). This does not use the new\n`validator.string` option as question processing logic fails when symbols are substituted for similar-looking\nsymbols." }, "type": { "description": "The type of the question. See `enum QuestionType` for more details.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.Question.QuestionType" } ] }, "is_mandatory": { "type": "boolean", "description": "Whether the question is mandatory or not" }, "multiple_choice_options": { "$ref": "#/$defs/s12.tasks.v1.MultipleChoiceOptions" } }, "description": "Question represents the question structure for a custom question." }, "s12.tasks.v1.Question.QuestionType": { "type": "string", "enum": [ "QUESTION_TYPE_UNSPECIFIED", "QUESTION_TYPE_TEXT", "QUESTION_TYPE_MULTIPLE_CHOICE" ], "default": "QUESTION_TYPE_UNSPECIFIED", "description": "- QUESTION_TYPE_UNSPECIFIED: The question type is unspecified. This generally should not happen.\n - QUESTION_TYPE_TEXT: The question is text type. This question accepts freetext answers.\n - QUESTION_TYPE_MULTIPLE_CHOICE: The question is multiple choice. This question provides a list of options to choose from.", "title": "The types of questions" }, "s12.tasks.v1.QuestionAnswer": { "type": "object", "properties": { "question_id": { "type": "string", "description": "The ID of the question being answered." }, "answer_text": { "description": "AnswerText indicates that the question being answered has a text\nresponse.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.AnswerText" } ] }, "answer_multiple_choice": { "description": "MultipleChoiceOption indicates that the question being answered is a multiple choice question.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.MultipleChoiceOption" } ] } }, "description": "QuestionAnswer contains data about a question configured for this issue's\ncategory, as well as the answer to that question." }, "s12.tasks.v1.Task.AddressLocation": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the task's location." }, "thoroughfare": { "type": "string", "description": "The thoroughfare of the location." }, "sub_thoroughfare": { "type": "string", "description": "The sub_thoroughfare of the location," }, "locality": { "type": "string", "description": "The locality of the location" }, "sub_locality": { "type": "string", "description": "The sub_locality of the location" }, "administrative_area": { "type": "string", "description": "The administrative_area of the location" }, "sub_administrative_area": { "type": "string", "description": "The sub_administrative_area of the location" }, "postal_code": { "type": "string", "description": "The postal_code of the location" }, "country": { "type": "string", "description": "The country of the location" }, "iso_country_code": { "type": "string", "description": "The iso_country_code of the location" }, "geo_position": { "allOf": [ { "$ref": "#/$defs/s12.common.GeoPosition" } ], "description": "The geometry of the location" } }, "description": "The location of the task.\nThe latitude and longitude in the `geo_position` object are required.\nAll other fields are optional, but add extra context to the location on\nplatform." }, "s12.tasks.v1.Task.Collaborator": { "type": "object", "properties": { "collaborator_id": { "type": "string", "description": "A UUID uniquely identifying this collaborator." }, "collaborator_type": { "description": "The type of the collaborator i.e. group or user.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.CollaboratorType" } ] }, "assigned_role": { "description": "The role of the collaborator in this task.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.CollaboratorRole" } ] }, "user": { "description": "Collaborator details for an authenticated user.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.Task.User" } ] }, "group": { "description": "Collaborator details for a group.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.Task.Group" } ] }, "external_user": { "description": "Collaborator details for an external user.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.Task.ExternalUser" } ] }, "contributor": { "description": "Collaborator details for a contributor.", "allOf": [ { "$ref": "#/$defs/s12.tasks.v1.Task.Contributor" } ] } }, "description": "A collaborator is somebody who is involved with the task.\nThey have either created the task, or are assigned to it." }, "s12.tasks.v1.Task.Contributor": { "type": "object", "properties": { "id": { "type": "string", "description": "The UUID uniquely identifying this contributor" }, "name": { "type": "string", "description": "Optional. The contributor's name." }, "email": { "type": "string", "description": "Optional. The contributor's email address." }, "contact": { "type": "string", "description": "Optional. The contributor's (freetext) contact details." } }, "title": "The contributor that raised the issue" }, "s12.tasks.v1.Task.ExternalUser": { "type": "object", "properties": { "id": { "type": "string", "description": "The UUID uniquely identifying this external user." }, "email": { "type": "string", "description": "The email address of the external user." } }, "description": "The external user that is assigned to a task." }, "s12.tasks.v1.Task.Group": { "type": "object", "properties": { "group_id": { "type": "string", "description": "The UUID of this group." }, "name": { "type": "string", "description": "The name of the group" } }, "description": "The group that is assigned to a task." }, "s12.tasks.v1.Task.User": { "type": "object", "properties": { "user_id": { "type": "string", "description": "The UUID of this user." }, "firstname": { "type": "string", "description": "The first name of the user." }, "lastname": { "type": "string", "description": "The last name of the user." } }, "description": "The user associated to the task. They could be a creator or assignee." } } }