---
search:
  tags:
    - Topics
    - POST
seo:
  description: >-
    Access control. Reference for the POST /v1/topics/id/{topic_id}/message-path
    endpoint in the Roboto REST API.
sidebar:
  label: Add topic message path by id
  badge: POST
title: Add topic message path by id
type: openapi-operation
---
#### Access control
 - Restricted tokens need the API scope `api.everything_else`

`POST /v1/topics/id/{topic_id}/message-path`

**Request body** (`application/json`, required)

- `message_path` (string, required)
- `data_type` (string, required)
- `canonical_data_type` (CanonicalDataType, required) — Framework-independent data type of a message path, which Roboto uses to choose how to display its data. Each native field type, such as a field type of ROS 1 (http://wiki.ros.org/msg), ROS 2 (https://docs.ros.org/en/iron/Concepts/Basic/About-Interfaces.html#field-types) or uORB (https://docs.px4.io/main/en/middleware/uorb.html#adding-a-new-topic), maps onto one of these. For example: - \`\`float32\`\` -\> \`\`CanonicalDataType.Number\`\` - \`\`uint8\[\]\`\` -\> \`\`CanonicalDataType.Array\`\` - \`\`sensor\_msgs/Image\`\` -\> \`\`CanonicalDataType.Image\`\` - \`\`geometry\_msgs/Pose\`\` -\> \`\`CanonicalDataType.Object\`\` - \`\`std\_msgs/Header\`\` -\> \`\`CanonicalDataType.Object\`\` - \`\`string\`\` -\> \`\`CanonicalDataType.String\`\` - \`\`char\`\` -\> \`\`CanonicalDataType.String\`\` - \`\`bool\`\` -\> \`\`CanonicalDataType.Boolean\`\` - \`\`byte\`\` -\> \`\`CanonicalDataType.Byte\`\`
- `metadata` (object) — Initial key-value pairs to associate with this topic message path for discovery and search, e.g. \`{ 'min': 0.71, 'max': 1.77, 'classification': 'my-custom-classification-tag' }\`
- `path_in_schema` (string[], required) — List of path components representing the field's location in the source data schema. For nested fields like 'position.x', this would be \['position', 'x'\].

Request body example:

```json
{
  "message_path": "string",
  "data_type": "string",
  "canonical_data_type": "array",
  "metadata": {},
  "path_in_schema": [
    "string"
  ]
}
```

**Responses**

- `201` — CREATED
- `400` — A conversation with Roboto's AI is longer than the AI model can read at once. The conversation's messages and tool results, together with the AI's instructions, exceed the model's context window. The exception does not carry the token count or the model's limit.
- `401` — The caller's token is expired or malformed.
- `403` — The request would take the user or organization past a limit on a resource, such as AI credits.
- `404` — The request names an API route Roboto does not serve.
- `409` — The request conflicts with an existing resource, such as by giving a name another resource already has.
- `410` — The resource the request names is missing or has expired.
- `500` — Roboto reported an error that this release of the SDK cannot match to a specific exception class. Reported for an element of a :py:class:\`\~roboto.http.BatchResponse\` whose error names a code this release defines no class for, or that arrived without a code, without a message, or as text that is not an error envelope at all. It carries whatever code and message Roboto sent, so a caller handling the failure still learns what went wrong; when no message could be read, the message is the error's raw text. :py:meth:\`\~roboto.domain.devices.Device.create\_session\` raises it, and :py:meth:\`\~roboto.domain.devices.Device.create\_sessions\` lists it in the batch's :py:attr:\`\~roboto.http.BatchResponse.failed\`. The error envelope carries no status code, so \`\`http\_status\_code\`\` reports the 500 inherited from \`\`RobotoDomainException\`\` rather than the status the failure had.
- `501` — The request asks for an operation this deployment of Roboto does not provide.
- `503` — Roboto could not accept the request, such as under heavy load. Retrying later may succeed.
- `504` — Roboto ran out of time while processing the request. Retrying may succeed.
- `507` — The response to the request is larger than Roboto can send. Retrying the same request fails the same way; request less data at a time.

Response example, 201:

```json
{
  "data": {
    "canonical_data_type": "array",
    "created": "2019-08-24T14:15:22Z",
    "created_by": "string",
    "data_type": "string",
    "message_path": "string",
    "message_path_id": "string",
    "metadata": {},
    "modified": "2019-08-24T14:15:22Z",
    "modified_by": "string",
    "org_id": "string",
    "path_in_schema": [
      "string"
    ],
    "representations": [
      {
        "association": {
          "association_id": "string",
          "association_type": "dataset",
          "association_version": null,
          "parent": null
        },
        "created": "2019-08-24T14:15:22Z",
        "format": null,
        "modified": "2019-08-24T14:15:22Z",
        "representation_id": "string",
        "storage_format": "mcap",
        "topic_id": "string",
        "transformations": [
          "string"
        ],
        "version": 0
      }
    ],
    "source_path": "string",
    "topic_id": "string"
  }
}
```
