get_user_agreement_by_version

ManagementApi.get_user_agreement_by_version(version, role_id, projection_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Get a user agreement by version

Returns the user agreement for the Version path value plus an S3PresignedUrl for the markdown file (expires in 3600 seconds). Requires system-settings.view. Does not create a default agreement when the version is missing (IPV-1002).

Parameters:
  • version (str) – Unix epoch seconds as a decimal string, matching Version from list or create. Any other value that is not stored returns IPV-1002. (required)

  • role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Used for permission checks and audit logs. (required)

  • projection_expression (str) – Comma-separated field names, not trimmed. Omit this query. A non-empty value is applied with the list projection helper to a single object, then S3Path is read to build S3PresignedUrl, which returns RTE-1001. On success without this query, S3PresignedUrl is always added after the stored fields.

  • _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:

GetUserAgreementByVersionResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /user-agreements/{version}

Success (HTTP 200)

Agreement metadata and S3PresignedUrl for the requested Version.

Agreement found

{
  "AgreementName": "Default_User_Agreement",
  "Description": "Default Agreement",
  "Version": "1548975106",
  "S3Path": "s3://example-misc/user-agreements/1548975106.md",
  "S3PresignedUrl": "https://example-misc.s3.amazonaws.com/user-agreements/1548975106.md?X-Amz-Expires=3600",
  "CreatedBy": "System",
  "CreationTime": "2026-08-01 00:30:12"
}

Errors

Documented error codes: AUTH-1001, AUTH-1030, IPV-1002, RTE-1001, EMF-1001.

HTTP 400

AUTH-1001 when role_id is missing. AUTH-1030 when the role lacks system-settings.view. IPV-1002 when Version does not exist.

Missing permission

{
  "Message": "AUTH-1030 - User is not authorized to get specific version of user agreement due to the following missing permission(s) - {'system-settings': ['view']}"
}

Version not found

{
  "Message": "IPV-1002 - Invalid UserAgreementVersionId - 1548975106, resource not found."
}

HTTP 500

Uncaught Exception formatted as RTE-1001 via EMF-1001, including a non-empty projectionExpression or presigned URL failure.

Uncaught Exception

{
  "Message": "RTE-1001 - 'S3Path'."
}