POST /api/v1/projects ​

operationId: createProject

This operation is described by the generated OpenAPI contract.

Authentication ​

Provide either authentication method:

  • Bearer token (Authorization: Bearer <token>).
  • API token in the X-SketchForge-Token header.

Parameters ​

NameInRequiredSchemaDescription
If-MatchheaderNo{"type":"string","pattern":"^\\\"[0-9]+\\\"$"}Apply this write only when the project still has the quoted revision returned by a previous write. A mismatch returns 409 revision_mismatch with the current revision.

Request body ​

Required.

application/json ​

json
{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    }
  }
}

Responses ​

201 — Resource created. ​

Headers:

json
{
  "ETag": {
    "description": "The project revision after this write.",
    "schema": {
      "type": "string",
      "pattern": "^\\\"[0-9]+\\\"$"
    }
  }
}

Content type: application/json

json
{
  "type": "object",
  "required": [
    "project"
  ],
  "properties": {
    "project": {
      "type": "object",
      "required": [
        "id",
        "name",
        "shapes",
        "revision",
        "updatedAt",
        "packageBytes"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "shapes": {
          "type": "integer"
        },
        "revision": {
          "type": "number"
        },
        "updatedAt": {
          "type": "number"
        },
        "packageBytes": {
          "type": "integer"
        }
      }
    }
  }
}

400 — Invalid request. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "api_disabled",
        "unauthorized",
        "storage_unconfigured",
        "invalid_project_id",
        "invalid_shape_id",
        "invalid_body",
        "invalid_request",
        "project_not_found",
        "project_exists",
        "project_busy",
        "revision_mismatch",
        "shape_not_found",
        "shape_locked",
        "unsupported_kind",
        "unsupported_format",
        "unapplicable_fields",
        "too_many_shapes",
        "limit_exceeded",
        "geometry_failed",
        "cad_failed",
        "internal_error"
      ]
    },
    "revision": {
      "type": "number"
    }
  },
  "additionalProperties": true
}

401 — Authentication failed. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "api_disabled",
        "unauthorized",
        "storage_unconfigured",
        "invalid_project_id",
        "invalid_shape_id",
        "invalid_body",
        "invalid_request",
        "project_not_found",
        "project_exists",
        "project_busy",
        "revision_mismatch",
        "shape_not_found",
        "shape_locked",
        "unsupported_kind",
        "unsupported_format",
        "unapplicable_fields",
        "too_many_shapes",
        "limit_exceeded",
        "geometry_failed",
        "cad_failed",
        "internal_error"
      ]
    },
    "revision": {
      "type": "number"
    }
  },
  "additionalProperties": true
}

404 — Resource not found or API disabled. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "api_disabled",
        "unauthorized",
        "storage_unconfigured",
        "invalid_project_id",
        "invalid_shape_id",
        "invalid_body",
        "invalid_request",
        "project_not_found",
        "project_exists",
        "project_busy",
        "revision_mismatch",
        "shape_not_found",
        "shape_locked",
        "unsupported_kind",
        "unsupported_format",
        "unapplicable_fields",
        "too_many_shapes",
        "limit_exceeded",
        "geometry_failed",
        "cad_failed",
        "internal_error"
      ]
    },
    "revision": {
      "type": "number"
    }
  },
  "additionalProperties": true
}

409 — The project is busy or the request conflicts with current state. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "api_disabled",
        "unauthorized",
        "storage_unconfigured",
        "invalid_project_id",
        "invalid_shape_id",
        "invalid_body",
        "invalid_request",
        "project_not_found",
        "project_exists",
        "project_busy",
        "revision_mismatch",
        "shape_not_found",
        "shape_locked",
        "unsupported_kind",
        "unsupported_format",
        "unapplicable_fields",
        "too_many_shapes",
        "limit_exceeded",
        "geometry_failed",
        "cad_failed",
        "internal_error"
      ]
    },
    "revision": {
      "type": "number"
    }
  },
  "additionalProperties": true
}

413 — Request exceeds the supported size or item limit. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "api_disabled",
        "unauthorized",
        "storage_unconfigured",
        "invalid_project_id",
        "invalid_shape_id",
        "invalid_body",
        "invalid_request",
        "project_not_found",
        "project_exists",
        "project_busy",
        "revision_mismatch",
        "shape_not_found",
        "shape_locked",
        "unsupported_kind",
        "unsupported_format",
        "unapplicable_fields",
        "too_many_shapes",
        "limit_exceeded",
        "geometry_failed",
        "cad_failed",
        "internal_error"
      ]
    },
    "revision": {
      "type": "number"
    }
  },
  "additionalProperties": true
}

500 — Server-side failure. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "api_disabled",
        "unauthorized",
        "storage_unconfigured",
        "invalid_project_id",
        "invalid_shape_id",
        "invalid_body",
        "invalid_request",
        "project_not_found",
        "project_exists",
        "project_busy",
        "revision_mismatch",
        "shape_not_found",
        "shape_locked",
        "unsupported_kind",
        "unsupported_format",
        "unapplicable_fields",
        "too_many_shapes",
        "limit_exceeded",
        "geometry_failed",
        "cad_failed",
        "internal_error"
      ]
    },
    "revision": {
      "type": "number"
    }
  },
  "additionalProperties": true
}

503 — Server-side failure. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "api_disabled",
        "unauthorized",
        "storage_unconfigured",
        "invalid_project_id",
        "invalid_shape_id",
        "invalid_body",
        "invalid_request",
        "project_not_found",
        "project_exists",
        "project_busy",
        "revision_mismatch",
        "shape_not_found",
        "shape_locked",
        "unsupported_kind",
        "unsupported_format",
        "unapplicable_fields",
        "too_many_shapes",
        "limit_exceeded",
        "geometry_failed",
        "cad_failed",
        "internal_error"
      ]
    },
    "revision": {
      "type": "number"
    }
  },
  "additionalProperties": true
}

Source ​

Route handler source · OpenAPI JSON · REST API guide


Documentation version: 1.30.0 · Repository revision: 1cb9fee8dff4d394684c229dd67a21da539d167f · View source