Updated on 2025-09-15 GMT+08:00

Creating a Service Agency

Function

This API is used to authorize an agency to Fabric. When you call this API, an agency is created and then authorized to Fabric. You can grant access by passing in the supported agency permission policies. This API is synchronous with no accompanying APIs or specific scenarios.

URI

POST /v1/agency

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

Definition: Tenant token. It is used for API calling authentication. For how to obtain a token, see [Authentication] (dataartsfabric_03_0005.xml).

Constraints: N/A.

Range: Up to 65,534 characters.

Default Value: N/A.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

policy_types

No

Array of strings

Definition: permission type list. To use DataArts Fabric functions, you may need to grant some permission policies by adding policy types to policy_types.

Constraints: N/A.

Range:

  • FABRIC_COMMON_POLICY: permission policy for basic common services, which is mandatory for agencies.

  • FABRIC_SELF_POLICY: permission policies required for accessing its own services.

  • FABRIC_SMN_POLICY: permission policies related to the notification function, which is used to forward system notifications to SMN.

  • FABRIC_LAKEFORMATION_POLICY: permission policies related to the LakeFormation function.

  • FABRIC_AOM_POLICY: permission policies related to the AOM function.

  • FABRIC_SWR_POLICY: permission policies related to the image package registration function.

  • FABRIC_LTS_POLICY: permission policies related to the log function.

  • FABRIC_VPCEP_POLICY: permission policies related to the network connection function.

  • FABRIC_DNS_POLICY: permission policies related to DNS.

  • FABRIC_OBS_POLICY: permission policies related to OBS.

Default Value: N/A.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

-

AnyType

OK

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 404

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 408

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Example Requests

Authorize the FABRIC_LAKEFORMATION_POLICY policy.

POST https://{endpoint}/v1/agency

{
  "policy_types" : [ "FABRIC_LAKEFORMATION_POLICY" ]
}

Example Responses

Status code: 200

OK

{
  "policy_types" : [ "FABRIC_LAKEFORMATION_POLICY" ]
}

Status code: 400

BadRequest

{
  "error_code" : "common.01000001",
  "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error" : {
    "code" : "403",
    "message" : "X-Auth-Token is invalid in the request",
    "title" : "Forbidden"
  },
  "error_code" : 403,
  "error_msg" : "X-Auth-Token is invalid in the request",
  "title" : "Forbidden"
}

Status code: 404

NotFound

{
  "error_code" : "common.01000001",
  "error_msg" : "response status exception, code: 404"
}

Status code: 408

Request Time-out

{
  "error_code" : "common.00000408",
  "error_msg" : "timeout exception occurred"
}

Status code: 500

InternalServerError

{
  "error_code" : "common.00000500",
  "error_msg" : "internal error"
}

Status Codes

Status Code

Description

200

OK

400

BadRequest

401

Unauthorized

403

Forbidden

404

NotFound

408

Request Time-out

500

InternalServerError

Error Codes

See Error Codes.