POST /api/legals

Assigns a document as a legal agreement on the platform, and adds information about the agreement.

Before running this operation, you must upload the legal document using the content API. Follow these steps:

  1. Have the legal agreement in place (text or html file).
  2. Upload the legal agreement to the resources/home/landing folder either via the user interface (Administration / Config / Resources / Content, navigate down to home/landing folder) or by using the Content API, POST /content/{path} operation.
  3. Assign the new document to be a platform legal agreement by running this operation.

Note: First, make sure there isn't already a portal signup legal agreement. The API platform allows only one signup agreement. If there is one already existing, you'll have to deactivate it first. For instruction on how to do that in the developer portal, refer to the developer portal Site Admin help. To deactivate/update using the API, use the PUT /api/legals/{LegalDocumentID} operation.

Authorization Roles/Permissions: Must be logged in. Site Admin

This topic includes the following sections:

HTTP Method


Back to top



Back to top

Sample Request

The example below adds a signup agreement to the platform.

Request URL


Sample request headers

Content-Type: application/json
Accept: text/plain

Sample request body

  "Name" : "Platform User Agreement",
  "Description" : "User Signup Agreement",
  "AgreementType" : "com.soa.atmosphere.legals.signup",
  "ContentPath" : "/home/landing/platform_signup.txt",
  "Active" : true,
  "PrintContentPath" : "/home/landing/platform_signup.txt",
  "DocumentState" : "",
  "FileName" : "platform_signup.txt"

Back to top

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept Any Accept header value that supports a response Content-Type of text/plain is valid; for example, */*.

Any one of the following media types is valid for the request Content-Type:


application/vnd.soa.v71+json or application/vnd.soa.v71+xml

application/vnd.soa.v72+json or application/vnd.soa.v72+xml

application/vnd.soa.v80+json or application/vnd.soa.v80+xml

application/vnd.soa.v81+json or application/vnd.soa.v81+xml

X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
AgreementDocument POST AgreementDocument Required Contains information about a platform legal agreement document.

Back to top


If successful, this operation returns HTTP status code 200. There is no other response.

Note: If you need to get the LegalDocumentID assigned to the agreement, run the GET /api/legals operation with the applicable AgreementType parameter: https://{hostname}/api/legals?AgreementType=com.soa.atmosphere.legals.signup

Back to top

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

Status Code: 200 OK
Date: Fri, 2 May 2014 18:31:00 GMT

Sample response body

Not applicable.

Back to top

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type text/plain

Back to top

Response Body

Not applicable.

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
405 Method Not Allowed. For example, you might get this if you specified an invalid Accept header or omitted a required Content-Type header, or used the wrong HTTP verb.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics