> For the complete documentation index, see [llms.txt](https://docs.truedat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.truedat.io/v8.8/api-integrations/data-catalog-data-lineage-and-grants-apis/relation-types.md).

# Relation Types

## List relation types

> Returns all relation types available in the system.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/relation_types":{"get":{"description":"Returns all relation types available in the system.","operationId":"TdDdWeb.RelationTypeController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationTypeListResponse"}}},"description":"Relation type list"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List relation types","tags":["Relation Types"]}}},"components":{"schemas":{"RelationTypeListResponse":{"additionalProperties":false,"properties":{"data":{"description":"List of relation types","items":{"$ref":"#/components/schemas/RelationTypeResource"},"type":"array"}},"required":["data"],"title":"RelationTypeListResponse","type":"object"},"RelationTypeResource":{"additionalProperties":false,"properties":{"description":{"description":"Description","nullable":true,"type":"string"},"id":{"description":"Relation type ID","type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"description":"Unique name","type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["id","name"],"title":"RelationTypeResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Create relation type

> Creates a new relation type with the provided payload.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/relation_types":{"post":{"description":"Creates a new relation type with the provided payload.","operationId":"TdDdWeb.RelationTypeController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationTypeCreateRequest"}}},"description":"Relation type payload","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationTypeResponse"}}},"description":"Relation type created"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnprocessableEntityChangesetResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create relation type","tags":["Relation Types"]}}},"components":{"schemas":{"RelationTypeCreateRequest":{"additionalProperties":false,"properties":{"relation_type":{"additionalProperties":false,"properties":{"description":{"description":"Description","nullable":true,"type":"string"},"name":{"description":"Unique name","type":"string"}},"required":["name"],"type":"object"}},"required":["relation_type"],"title":"RelationTypeCreateRequest","type":"object"},"RelationTypeResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/RelationTypeResource"}},"required":["data"],"title":"RelationTypeResponse","type":"object"},"RelationTypeResource":{"additionalProperties":false,"properties":{"description":{"description":"Description","nullable":true,"type":"string"},"id":{"description":"Relation type ID","type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"description":"Unique name","type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["id","name"],"title":"RelationTypeResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdForbiddenResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdForbiddenResponse","type":"object"},"TdDdUnprocessableEntityChangesetResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"}},"required":["errors"],"title":"TdDdUnprocessableEntityChangesetResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Get relation type

> Retrieves the relation type identified by the given ID.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/relation_types/{id}":{"get":{"description":"Retrieves the relation type identified by the given ID.","operationId":"TdDdWeb.RelationTypeController.show","parameters":[{"description":"Relation type ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationTypeResponse"}}},"description":"Relation type details"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get relation type","tags":["Relation Types"]}}},"components":{"schemas":{"RelationTypeResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/RelationTypeResource"}},"required":["data"],"title":"RelationTypeResponse","type":"object"},"RelationTypeResource":{"additionalProperties":false,"properties":{"description":{"description":"Description","nullable":true,"type":"string"},"id":{"description":"Relation type ID","type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"description":"Unique name","type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["id","name"],"title":"RelationTypeResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Update relation type

> Updates the specified relation type using the provided payload.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/relation_types/{id}":{"put":{"description":"Updates the specified relation type using the provided payload.","operationId":"TdDdWeb.RelationTypeController.update","parameters":[{"description":"Relation type ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationTypeCreateRequest"}}},"description":"Relation type payload","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationTypeResponse"}}},"description":"Relation type updated"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnprocessableEntityChangesetResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Update relation type","tags":["Relation Types"]}}},"components":{"schemas":{"RelationTypeCreateRequest":{"additionalProperties":false,"properties":{"relation_type":{"additionalProperties":false,"properties":{"description":{"description":"Description","nullable":true,"type":"string"},"name":{"description":"Unique name","type":"string"}},"required":["name"],"type":"object"}},"required":["relation_type"],"title":"RelationTypeCreateRequest","type":"object"},"RelationTypeResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/RelationTypeResource"}},"required":["data"],"title":"RelationTypeResponse","type":"object"},"RelationTypeResource":{"additionalProperties":false,"properties":{"description":{"description":"Description","nullable":true,"type":"string"},"id":{"description":"Relation type ID","type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"description":"Unique name","type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["id","name"],"title":"RelationTypeResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdForbiddenResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdForbiddenResponse","type":"object"},"TdDdUnprocessableEntityChangesetResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"}},"required":["errors"],"title":"TdDdUnprocessableEntityChangesetResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Delete relation type

> Deletes the specified relation type.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/relation_types/{id}":{"delete":{"description":"Deletes the specified relation type.","operationId":"TdDdWeb.RelationTypeController.delete","parameters":[{"description":"Relation type ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Relation type deleted"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Delete relation type","tags":["Relation Types"]}}},"components":{"schemas":{"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Update relation type

> Updates the specified relation type using the provided payload.

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.8.2"},"paths":{"/api/relation_types/{id}":{"patch":{"description":"Updates the specified relation type using the provided payload.","operationId":"TdDdWeb.RelationTypeController.update (2)","parameters":[{"description":"Relation type ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationTypeCreateRequest"}}},"description":"Relation type payload","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationTypeResponse"}}},"description":"Relation type updated"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnprocessableEntityChangesetResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Update relation type","tags":["Relation Types"]}}},"components":{"schemas":{"RelationTypeCreateRequest":{"additionalProperties":false,"properties":{"relation_type":{"additionalProperties":false,"properties":{"description":{"description":"Description","nullable":true,"type":"string"},"name":{"description":"Unique name","type":"string"}},"required":["name"],"type":"object"}},"required":["relation_type"],"title":"RelationTypeCreateRequest","type":"object"},"RelationTypeResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/RelationTypeResource"}},"required":["data"],"title":"RelationTypeResponse","type":"object"},"RelationTypeResource":{"additionalProperties":false,"properties":{"description":{"description":"Description","nullable":true,"type":"string"},"id":{"description":"Relation type ID","type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"description":"Unique name","type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["id","name"],"title":"RelationTypeResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdForbiddenResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdForbiddenResponse","type":"object"},"TdDdUnprocessableEntityChangesetResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"}},"required":["errors"],"title":"TdDdUnprocessableEntityChangesetResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```
