add_project_stewards

ArtificialIntelligenceApi.add_project_stewards(project_id, role_id, add_or_remove_project_stewards_request_body, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Add project stewards

Adds one or more users to the steward list of an AI project. Stewards are the people notified whenever a comment is posted on the project. You must be an owner or editor of the project, and every user you add must already have owner or editor access on it — the whole request is rejected if any of them does not. Adding a user who is already a steward changes nothing and still succeeds.

Parameters:
  • project_id (str) – Identifier of the AI project to add stewards to. This is the ProjectId returned when the project was created. (required)

  • role_id (str) – Amorphic role used to authorize this request. (required)

  • add_or_remove_project_stewards_request_body (AddOrRemoveProjectStewardsRequestBody) – (required)

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

AddProjectStewardsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: POST /ai/projects/{project_id}/stewards

Request

Request / response example

{
  "ProjectStewards": [
    "john",
    "priya"
  ]
}

Success (HTTP 200)

The users were added to the project’s steward list.

Request / response example

{
  "Message": "Successfully added user(s) to project stewards."
}

Errors

Documented error codes: AUTH-1001, AUTH-1030, IPV-1002, AUTH-1012, IPV-1001, IPV-1045, IPV-1004, GE-1008.

HTTP 400

The request was invalid or you do not have permission. The body is {“Message”: “<CODE> - <text>”}. Common cases include a missing role_id header (AUTH-1001), a role without the ai.manage permission (AUTH-1030), an unknown project (IPV-1002), a caller who is not an owner or editor of the project (AUTH-1012), a missing or empty ProjectStewards list (IPV-1001), list entries that are not user IDs (IPV-1045), and users who lack owner or editor access on the project (IPV-1004). Permission failures return 400, not 403.

Caller is not an owner or editor of the project

{
  "Message": "AUTH-1012 - User: john.doe requires at least editor access to update project stewards."
}

ProjectStewards missing or empty

{
  "Message": "IPV-1001 - Parameter ProjectStewards is a required value."
}

A listed user is not an owner or editor

{
  "Message": "IPV-1004 - The following user(s) need Owner or Editor permissions: priya.nair to add as stewards."
}

No such project

{
  "Message": "IPV-1002 - Invalid ProjectId - 7c3f21ab-4d5e-4a19-9b0c-2f8e6d1a4b73, resource not found."
}

HTTP 500

An unexpected server error. The body is {“Message”: “<CODE> - <text>”}, normally GE-1008.

Request / response example

{
  "Message": "GE-1008 - Could not complete the request. Please try again."
}