Skip to content

For AI agents: every API docs page in one plain-text file is at /docs/llms-full.txt, and the documentation index is at /llms.txt. This page is available as Markdown at https://diffio.ai/docs/api-reference/revoke-project-share.md, and every docs URL returns Markdown when requested with Accept: text/markdown.

Revoke a project's share

Revokes a project's published share. Existing share URLs stop working within about 60 seconds, and Get a share returns 404 (share_not_found).

DELETE https://api.diffio.ai/v2/projects/{project_id}/share

  • Key scope: projects:write
  • Auth header:Authorization: Bearer <apiKey>
  • Body: None

Request

Pass project_id in the path; takes no request body.

Path parameters

FieldTypeRequiredDescription
#project_idstringRequired: YesUnique identifier of the project.

Headers

FieldTypeRequiredDescription
#Diffio-End-UserstringRequired: NoOptional end-user identifier (up to 128 characters). Scopes the request to that end user's projects; omit to act across the whole account.

Request

import os
from diffio import DiffioClient

key = os.environ["DIFFIO_API_KEY"]
client = DiffioClient(api_key=key)

revoked = client.shares.revoke(
    "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
)

Response

Returns deleted: true and the revoked share id (or null if the project was never shared).

Success: 200OK.

Response fields

FieldTypePresentDescription
#objectstringAlwaysResource type, always "project_share".project_share
#idstring | nullAlwaysRevoked 17-character share identifier, or null when the project never had a share.
#project_idstringAlwaysIdentifier of the project.
#deletedbooleanAlwaysAlways true.true

Response 200OK.

Successful response
{
  "object": "project_share",
  "id": "Hq7cTnWm3RkZpY2vB",
  "project_id": "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
  "deleted": true
}

Return codes

  • 200OK.Share revoked (or project had no share).
  • 400Bad request.Diffio-End-User exceeds 128 characters. invalid_header
  • 403Forbidden: the key lacks permission.Key is inactive or lacks projects:write. permission_denied
  • 404Not found.No project with that project_id exists for this account and end user. project_not_found
  • 409Conflict: see error.code for which one.Project is currently being deleted, or a concurrent publish reserved after this revoke won (code conflict). not_available
  • 401Unauthorized: the API key is missing or invalid.405Client error.Same on every endpoint
    • 401Unauthorized: the API key is missing or invalid. Missing API key (code missing_api_key), or invalid API key (code invalid_api_key).
    • 405Client error. HTTP method not supported on this path; check the Allow header (code method_not_allowed).

Example error response

Errors are JSON: an error object with code, message and request_id. An unrecognized key returns 401Unauthorized: the API key is missing or invalid.:

Error response
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid API key.",
    "request_id": "dead773b60e148fd9e22d680a22fa701"
  }
}

Notes

  • Idempotent: calling DELETE on an unshared or already-revoked project returns 200 with deleted: true.
  • Deleting a project via Delete a project revokes its share automatically.

Report an issue with this page