Recent searches

in

Editing Sessions

On this page

Get an Editing Session's details

GET/api/v0/editing_sessions/{editing_session_uuid}
Path parameters:
editing_session_uuidUUIDRequired#
Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid} \
  -H "X-API-KEY: <your-api-key>"
Responses:
200OK
JSON
Copied to clipboard
{
  "uuid": "00000000-0000-0000-0000-000000000000",
  "id": 0,
  "site_id": 0,
  "build_id": 0,
  "state": "string",
  "base_commit_hash": "string",
  "upstream_commit_hash": "string",
  "syncs_blocked": 0,
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z",
  "site_uuid": "00000000-0000-0000-0000-000000000000",
  "build_uuid": "00000000-0000-0000-0000-000000000000",
  "files": [
    {
      "uuid": "00000000-0000-0000-0000-000000000000",
      "id": 0,
      "editing_session_uuid": "string",
      "edit_type": "string",
      "source_path": "string",
      "path": "string",
      "sync_blocked": true,
      "has_conflict": true,
      "unchanged": true,
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z",
      "metadata": {},
      "contributions": [
        {}
      ]
    }
  ]
}
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}

Abort a merge on an Editing Session

DELETE/api/v0/editing_sessions/{editing_session_uuid}/abort
Path parameters:
editing_session_uuidUUIDRequired#
Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/abort \
  -X DELETE \
  -H "X-API-KEY: <your-api-key>"
Responses:
204No Content
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}
422Unprocessable
JSON
Copied to clipboard
{
  "errors": {}
}

Clone a file in an Editing Session

POST/api/v0/editing_sessions/{editing_session_uuid}/clone_path
Path parameters:
editing_session_uuidUUIDRequired#
Request body:
sourcestring#

The path of the file to copy

targetstring#

The path for the copied file

pathsArray<object>#
sourcestring#

The path of the file to copy

targetstring#

The path for the copied file

allow_overwriteboolean#

Overwrite the target file if it already exists

metadataobject#

Additional metadata to store on the file

Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/clone_path \
  -X POST \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "string",
    "target": "string",
    "paths": [
      {
        "source": "string",
        "target": "string"
      }
    ],
    "allow_overwrite": true,
    "metadata": {}
  }'
Responses:
200OK
JSON
Copied to clipboard
[
  {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "id": 0,
    "editing_session_uuid": "string",
    "edit_type": "string",
    "source_path": "string",
    "path": "string",
    "sync_blocked": true,
    "has_conflict": true,
    "unchanged": true,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "metadata": {},
    "contributions": [
      {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "id": 0,
        "editing_session_file_uuid": "string",
        "session_type": "string",
        "user_uuid": "string",
        "session_uuid": "string",
        "state": "string",
        "file_contents": "string",
        "generated_by_merge": true,
        "content_hash": "string",
        "ended_at": "2024-01-01T00:00:00Z",
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z"
      }
    ]
  }
]
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}
422Unprocessable
JSON
Copied to clipboard
{
  "errors": {}
}

Commit an Editing Session to its Git Provider

POST/api/v0/editing_sessions/{editing_session_uuid}/commit
Path parameters:
editing_session_uuidUUIDRequired#
Request body:
messagestring#

The commit message

includeobject#

Which files to save, keyed by file UUID. Omit to save all files in the session.

Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/commit \
  -X POST \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "string",
    "include": {}
  }'
Responses:
200OK
JSON
Copied to clipboard
{
  "socket_message_id": "string"
}
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}
422Unprocessable
JSON
Copied to clipboard
{
  "errors": {}
}

Delete a file in an Editing Session

POST/api/v0/editing_sessions/{editing_session_uuid}/delete_path
Path parameters:
editing_session_uuidUUIDRequired#
Request body:
targetstring#

The path of the file to delete

pathsArray<object>#
targetstring#

The path of the file to delete

discard_unsavedboolean#

Confirm that you want to discard uncommitted edits. Without this, the request will fail if there are uncommitted edits.

Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/delete_path \
  -X POST \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "target": "string",
    "paths": [
      {
        "target": "string"
      }
    ],
    "discard_unsaved": true
  }'
Responses:
200OK
JSON
Copied to clipboard
[
  {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "id": 0,
    "editing_session_uuid": "string",
    "edit_type": "string",
    "source_path": "string",
    "path": "string",
    "sync_blocked": true,
    "has_conflict": true,
    "unchanged": true,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "metadata": {},
    "contributions": [
      {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "id": 0,
        "editing_session_file_uuid": "string",
        "session_type": "string",
        "user_uuid": "string",
        "session_uuid": "string",
        "state": "string",
        "file_contents": "string",
        "generated_by_merge": true,
        "content_hash": "string",
        "ended_at": "2024-01-01T00:00:00Z",
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z"
      }
    ]
  }
]
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}
422Unprocessable
JSON
Copied to clipboard
{
  "errors": {}
}

List an Editing Session's files

GET/api/v0/editing_sessions/{editing_session_uuid}/files
Path parameters:
editing_session_uuidUUIDRequired#
Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/files \
  -H "X-API-KEY: <your-api-key>"
Responses:
200OK
JSON
Copied to clipboard
[
  {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "id": 0,
    "editing_session_uuid": "string",
    "edit_type": "string",
    "source_path": "string",
    "path": "string",
    "sync_blocked": true,
    "has_conflict": true,
    "unchanged": true,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "metadata": {},
    "contributions": [
      {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "id": 0,
        "editing_session_file_uuid": "string",
        "session_type": "string",
        "user_uuid": "string",
        "session_uuid": "string",
        "state": "string",
        "file_contents": "string",
        "generated_by_merge": true,
        "content_hash": "string",
        "ended_at": "2024-01-01T00:00:00Z",
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z"
      }
    ]
  }
]
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}

Create a file in an Editing Session

POST/api/v0/editing_sessions/{editing_session_uuid}/files
Path parameters:
editing_session_uuidUUIDRequired#
Request body:
edit_typestringNullable#
pathstringNullable#
source_pathstringNullable#
discard_unsavedboolean#
previous_content_hashstring#
metadataobject#
Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/files \
  -X POST \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "edit_type": "string",
    "path": "string",
    "source_path": "string",
    "discard_unsaved": true,
    "previous_content_hash": "string",
    "metadata": {}
  }'
Responses:
200Success
JSON
Copied to clipboard
{
  "uuid": "00000000-0000-0000-0000-000000000000",
  "id": 0,
  "editing_session_uuid": "string",
  "edit_type": "string",
  "source_path": "string",
  "path": "string",
  "sync_blocked": true,
  "has_conflict": true,
  "unchanged": true,
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z",
  "metadata": {},
  "contributions": [
    {
      "uuid": "00000000-0000-0000-0000-000000000000",
      "id": 0,
      "editing_session_file_uuid": "string",
      "session_type": "string",
      "user_uuid": "string",
      "session_uuid": "string",
      "state": "string",
      "file_contents": "string",
      "generated_by_merge": true,
      "content_hash": "string",
      "ended_at": "2024-01-01T00:00:00Z",
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ]
}
201Created
JSON
Copied to clipboard
{
  "uuid": "00000000-0000-0000-0000-000000000000",
  "id": 0,
  "editing_session_uuid": "string",
  "edit_type": "string",
  "source_path": "string",
  "path": "string",
  "sync_blocked": true,
  "has_conflict": true,
  "unchanged": true,
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z",
  "metadata": {},
  "contributions": [
    {
      "uuid": "00000000-0000-0000-0000-000000000000",
      "id": 0,
      "editing_session_file_uuid": "string",
      "session_type": "string",
      "user_uuid": "string",
      "session_uuid": "string",
      "state": "string",
      "file_contents": "string",
      "generated_by_merge": true,
      "content_hash": "string",
      "ended_at": "2024-01-01T00:00:00Z",
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ]
}
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}
422Unprocessable
JSON
Copied to clipboard
{
  "errors": {}
}

Move a file in an Editing Session

POST/api/v0/editing_sessions/{editing_session_uuid}/move_path
Path parameters:
editing_session_uuidUUIDRequired#
Request body:
sourcestring#

The current path of the file to move

targetstring#

The new path for the file

pathsArray<object>#
sourcestring#

The current path of the file to move

targetstring#

The new path for the file

allow_overwriteboolean#

Overwrite the target file if it already exists

metadataobject#

Additional metadata to store on the file

Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/move_path \
  -X POST \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "string",
    "target": "string",
    "paths": [
      {
        "source": "string",
        "target": "string"
      }
    ],
    "allow_overwrite": true,
    "metadata": {}
  }'
Responses:
200OK
JSON
Copied to clipboard
[
  {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "id": 0,
    "editing_session_uuid": "string",
    "edit_type": "string",
    "source_path": "string",
    "path": "string",
    "sync_blocked": true,
    "has_conflict": true,
    "unchanged": true,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "metadata": {},
    "contributions": [
      {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "id": 0,
        "editing_session_file_uuid": "string",
        "session_type": "string",
        "user_uuid": "string",
        "session_uuid": "string",
        "state": "string",
        "file_contents": "string",
        "generated_by_merge": true,
        "content_hash": "string",
        "ended_at": "2024-01-01T00:00:00Z",
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z"
      }
    ]
  }
]
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}
422Unprocessable
JSON
Copied to clipboard
{
  "errors": {}
}

Restore a deleted file in an Editing Session

POST/api/v0/editing_sessions/{editing_session_uuid}/restore_path
Path parameters:
editing_session_uuidUUIDRequired#
Request body:
targetstring#

The path of the deleted file to restore

pathsArray<object>#
targetstring#

The path of the deleted file to restore

Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/restore_path \
  -X POST \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "target": "string",
    "paths": [
      {
        "target": "string"
      }
    ]
  }'
Responses:
200OK
JSON
Copied to clipboard
[
  {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "id": 0,
    "editing_session_uuid": "string",
    "edit_type": "string",
    "source_path": "string",
    "path": "string",
    "sync_blocked": true,
    "has_conflict": true,
    "unchanged": true,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "metadata": {},
    "contributions": [
      {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "id": 0,
        "editing_session_file_uuid": "string",
        "session_type": "string",
        "user_uuid": "string",
        "session_uuid": "string",
        "state": "string",
        "file_contents": "string",
        "generated_by_merge": true,
        "content_hash": "string",
        "ended_at": "2024-01-01T00:00:00Z",
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z"
      }
    ]
  }
]
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}
422Unprocessable
JSON
Copied to clipboard
{
  "errors": {}
}

Upload a file to an Editing Session

POST/api/v0/editing_sessions/{editing_session_uuid}/upload_file
Path parameters:
editing_session_uuidUUIDRequired#
Request body:
targetstring#

The path to upload the file to

s3_keystring#

The storage key of the uploaded file contents

content_hashstring#

The hash of the uploaded file contents

filesArray<object>#
targetstring#

The path to upload the file to

s3_keystring#

The storage key of the uploaded file contents

content_hashstring#

The hash of the uploaded file contents

allow_overwriteboolean#

Overwrite the target file if it already exists

Example request:
Bash
Copied to clipboard
curl https://app.cloudcannon.com/api/v0/editing_sessions/{editing_session_uuid}/upload_file \
  -X POST \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "target": "string",
    "s3_key": "string",
    "content_hash": "string",
    "files": [
      {
        "target": "string",
        "s3_key": "string",
        "content_hash": "string"
      }
    ],
    "allow_overwrite": true
  }'
Responses:
200OK
JSON
Copied to clipboard
[
  {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "id": 0,
    "editing_session_uuid": "string",
    "edit_type": "string",
    "source_path": "string",
    "path": "string",
    "sync_blocked": true,
    "has_conflict": true,
    "unchanged": true,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "metadata": {},
    "contributions": [
      {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "id": 0,
        "editing_session_file_uuid": "string",
        "session_type": "string",
        "user_uuid": "string",
        "session_uuid": "string",
        "state": "string",
        "file_contents": "string",
        "generated_by_merge": true,
        "content_hash": "string",
        "ended_at": "2024-01-01T00:00:00Z",
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z"
      }
    ]
  }
]
403Forbidden
JSON
Copied to clipboard
{
  "error": "string"
}
404Not Found
JSON
Copied to clipboard
{
  "error": "string"
}
422Unprocessable
JSON
Copied to clipboard
{
  "errors": {}
}
Open in a new tab