---
updatedAt: 2026-05-27T01:08:11.000Z
agentTools:
  projectIndex: https://docs.d-id.com/llms.txt
---

# Create an animation

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Legacy Endpoints",
    "version": "0.1"
  },
  "servers": [
    {
      "url": "https://api.d-id.com/"
    }
  ],
  "paths": {
    "/animations": {
      "post": {
        "operationId": "CreateAnimation",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAnimationResponseDto"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "id": "52907745-7672-470e-a803-a2f8feb52944",
                      "object": "animation",
                      "created_at": "2020-09-03T13:56:54.995",
                      "created_by": "995",
                      "status": "created"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "BadRequestError | InvalidFileSizeError | InvalidImageResolutionError | ConfigError | InvalidFaceError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonError"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "kind": "BadRequestError",
                      "description": "invalid source url"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "AuthorizationError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonError"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "kind": "AuthorizationError",
                      "description": "user unauthenticated"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "InsufficientCreditsError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonError"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "kind": "InsufficientCreditsError",
                      "description": "not enough credits"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "PermissionError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonError"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "kind": "PermissionError",
                      "description": "user has no permission for stitch"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Create an animation",
        "tags": [
          "Animations"
        ],
        "deprecated": true,
        "security": [
          {
            "basic": []
          },
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAnimationDto"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AnimationStatus": {
        "enum": [
          "created",
          "done",
          "error",
          "started"
        ],
        "type": "string"
      },
      "CreateAnimationResponseDto": {
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the animation"
          },
          "object": {
            "type": "string",
            "description": "An identifier of this animation"
          },
          "created_by": {
            "type": "string",
            "description": "The user id of the user that created the animation"
          },
          "created_at": {
            "type": "string",
            "description": "Animation creation time as iso-8601 string"
          },
          "status": {
            "$ref": "#/components/schemas/AnimationStatus",
            "description": "The status of the animation"
          }
        },
        "required": [
          "id",
          "object",
          "created_by",
          "created_at",
          "status"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "JsonError": {
        "properties": {
          "kind": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "details": {},
          "internal": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "description"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "DriverUrl": {
        "type": "string",
        "pattern": "(https|s3|bank):\\/\\/.+"
      },
      "RemoteUrl": {
        "type": "string",
        "example": "https://path.to.directory/movie.mp4",
        "pattern": "(https|s3):\\/\\/.+"
      },
      "Dimension": {
        "type": "number",
        "format": "double",
        "maximum": 8000
      },
      "OverlapKind": {
        "enum": [
          "NO",
          "PARTIAL",
          "YES",
          "UNKNOWN"
        ],
        "type": "string"
      },
      "Rect": {
        "properties": {
          "top": {
            "$ref": "#/components/schemas/Dimension"
          },
          "left": {
            "$ref": "#/components/schemas/Dimension"
          },
          "bottom": {
            "$ref": "#/components/schemas/Dimension"
          },
          "right": {
            "$ref": "#/components/schemas/Dimension"
          }
        },
        "required": [
          "top",
          "left",
          "bottom",
          "right"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "FaceSquareDto": {
        "properties": {
          "size": {
            "type": "integer",
            "format": "int32",
            "description": "Size of the square side",
            "minimum": 0
          },
          "top_left": {
            "items": {
              "$ref": "#/components/schemas/Dimension"
            },
            "type": "array",
            "description": "Top left location of the face in the frame - can be negative",
            "minItems": 2,
            "maxItems": 2
          },
          "overlap": {
            "$ref": "#/components/schemas/OverlapKind"
          },
          "face_id": {
            "type": "string"
          },
          "detect_confidence": {
            "type": "number",
            "format": "double"
          },
          "sharpness": {
            "type": "number",
            "format": "double"
          },
          "face_occluded": {
            "type": "boolean"
          },
          "face_occluded_confidence": {
            "type": "number",
            "format": "double"
          },
          "detection": {
            "$ref": "#/components/schemas/Rect"
          }
        },
        "required": [
          "size",
          "top_left"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "SecuredUrl": {
        "type": "string",
        "pattern": "^(?:https):\\/\\/[\\S]+$"
      },
      "Logo": {
        "properties": {
          "url": {
            "type": "string",
            "description": "https url to an ARGB jpg/png image, a default logo is used otherwise",
            "pattern": "((https|s3):\\/\\/.+)"
          },
          "position": {
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "type": "array",
            "description": "position of the logo in pixels from the top left corner (w,h) negative values are subtracted from last pixel",
            "example": [
              0,
              500
            ],
            "minItems": 2,
            "maxItems": 2
          }
        },
        "required": [
          "url",
          "position"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "LogoDto": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Logo"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "VideoPath": {
        "type": "string",
        "example": "https://path.to.directory/movie.mp4",
        "pattern": "(https|s3):.*\\.(?:mp4|MP4|mov|MOV|mpeg|MPEG)"
      },
      "ResultFormat": {
        "type": "string",
        "enum": [
          "mp4",
          "mov"
        ]
      },
      "AnimateConfigDto": {
        "properties": {
          "logo": {
            "$ref": "#/components/schemas/LogoDto"
          },
          "overlay": {
            "$ref": "#/components/schemas/VideoPath",
            "description": "URL to overlay video to add on the animated result"
          },
          "mute": {
            "type": "boolean",
            "description": "mutes the driver sound in the animated video result, defaults to true"
          },
          "stitch": {
            "type": "boolean",
            "description": "stitch back the animated result to the original image"
          },
          "max_animated_faces": {
            "type": "number",
            "format": "double",
            "description": "the amount of faces to animate when stitch: true. Defaults to 5",
            "minimum": 1,
            "maximum": 5
          },
          "result_format": {
            "$ref": "#/components/schemas/ResultFormat",
            "description": "the file format of the animated video result"
          }
        },
        "type": "object",
        "additionalProperties": false
      },
      "UserData": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000,
        "pattern": "^(?!\\s*$).+$"
      },
      "CreateAnimationDto": {
        "properties": {
          "source_url": {
            "type": "string",
            "description": "The URL of the source image to be animated by the driver video. Image type of jpg|jpeg|tiff|png|bmp",
            "example": "https://path.to.directory/image.jpg",
            "default": "https://d-id-public-bucket.s3.us-west-2.amazonaws.com/alice.jpg",
            "pattern": "(https|s3):.*\\.(?:jpg|jpeg|tiff|png|bmp|JPG|JPEG|TIFF|PNG|BMP)"
          },
          "driver_url": {
            "$ref": "#/components/schemas/DriverUrl",
            "description": "The URL of the driver video to drive the animation, if not provided a driver video will be selected for you from the predefined DriversBank",
            "example": "bank://nostalgia/"
          },
          "result_url": {
            "$ref": "#/components/schemas/RemoteUrl",
            "description": "The URL of the animation video, if not provided use default destination\nSupports S3 Signed URLs",
            "example": "https://path.to.directory/movie.mp4"
          },
          "face": {
            "$ref": "#/components/schemas/FaceSquareDto",
            "description": "the face to animate - otherwise detects the dominant face",
            "example": {
              "top_left": [
                0,
                0
              ],
              "size": 512
            }
          },
          "webhook": {
            "$ref": "#/components/schemas/SecuredUrl",
            "description": "A webhook URL for sending the payload including animate details. In a case of empty value, the webhook will not be triggered",
            "example": "https://host.domain.tld/to/webhook"
          },
          "config": {
            "$ref": "#/components/schemas/AnimateConfigDto",
            "description": "Advanced configuration option"
          },
          "user_data": {
            "$ref": "#/components/schemas/UserData",
            "description": "Non-sensitive custom data that will be added to the animation response and webhook."
          }
        },
        "type": "object",
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "basic": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-readme": {
    "samples-languages": [
      "curl"
    ]
  }
}
```