---
updatedAt: 2026-05-27T07:59:50.000Z
agentTools:
  projectIndex: https://docs.d-id.com/llms.txt
---

# Create a consent

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Resources Endpoints",
    "version": "0.1"
  },
  "servers": [
    {
      "url": "https://api.d-id.com/"
    }
  ],
  "paths": {
    "/consents": {
      "post": {
        "operationId": "Create",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateConsentResponseDto"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "id": "52907745-7672-470e-a803-a2f8feb52944",
                      "created_at": "2020-09-03T13:56:54.995",
                      "created_by": "3413123-1312wd-fsd123-12312",
                      "text": "Festivus for everyone"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "AuthorizationError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonError"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "kind": "AuthorizationError",
                      "description": "user unauthenticated"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Create a consent",
        "tags": [
          "Consents"
        ],
        "security": [
          {
            "basic": []
          },
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConsentRequestDto"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "JsonError": {
        "properties": {
          "kind": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "details": {},
          "internal": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "description"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "CreateConsentResponseDto": {
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the consent"
          },
          "created_at": {
            "type": "string",
            "description": "Consent creation time as iso-8601 string"
          },
          "created_by": {
            "type": "string",
            "description": "The user id of the user that created the consent"
          },
          "text": {
            "type": "string",
            "description": "A random text with 3 words to be used as a consent"
          }
        },
        "required": [
          "id",
          "created_at",
          "created_by",
          "text"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "CreateConsentRequestDto": {
        "properties": {
          "language": {
            "type": "string",
            "description": "The language of the consent.\nSupported languages: Dutch, Turkish, Swedish, Indonesian, Filipino, Czech, Romanian, Danish, Malay, Slovak, Croatian, English, Polish, German, Spanish, French, Italian, Portuguese",
            "example": "english"
          }
        },
        "required": [
          "language"
        ],
        "type": "object",
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "basic": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-readme": {
    "samples-languages": [
      "curl"
    ]
  }
}
```