{
  "openapi": "3.0.1",
  "info": {
    "title": "SSO Role Mapping",
    "description": "Create and alter the role mappings, to assign automatically Talend roles to your SSO users.",
    "contact": {},
    "version": "2021-03"
  },
  "servers": [
    {
      "url": "https://api.eu.cloud.talend.com",
      "description": "URL for the AWS Europe region",
      "x-talend": {
        "isPublished": true
      }
    },
    {
      "url": "https://api.ap.cloud.talend.com",
      "description": "URL for the AWS Asia Pacific region",
      "x-talend": {
        "isPublished": true
      }
    },
    {
      "url": "https://api.us.cloud.talend.com",
      "description": "URL for the AWS United States East region",
      "x-talend": {
        "isPublished": true
      }
    },
    {
      "url": "https://api.au.cloud.talend.com",
      "description": "URL for the AWS Australia region",
      "x-talend": {
        "isPublished": true
      }
    },
    {
      "url": "https://api.us-west.cloud.talend.com",
      "description": "URL for the Azure United States West region",
      "x-talend": {
        "isPublished": true
      }
    }
  ],
  "security": [
    {
      "Public": []
    }
  ],
  "paths": {
    "/security/role-mappings": {
      "summary": "Operations on role mappings",
      "description": "Role mappings are part of single sign-on (SSO). This feature allows you to describe which Talend roles to assign to your users based on their roles in you organization.\n\nThe feature is activated for your tenant if at least one role mapping is defined.\n\nThe Talend roles assigned to a user at SSO login using role mapping will replace those defined in TMC for *Just-in-time user provisioning*.\n\nA role mapping has the following format:\n```\n{\n  \"name\":\"role_1\",\n  \"roles\":[\n    \"talend_role_1\",\n    \"talend_role_2\",\n    \"talend_role_3\"\n  ]\n}\n```\n- The attribute `name` is the name of the role in you organization. It must be unique.\n- The attribute `roles` is an array of Talend roles name associated to the role in your organization.",
      "get": {
        "summary": "Get all role mappings",
        "description": "Return the list of all role mappings for your tenant.",
        "responses": {
          "200": {
            "description": "Status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RoleMapping"
                  }
                },
                "example": "[\n   {\n      \"name\":\"role_1\",\n      \"roles\":[\n         \"talend_role_1\",\n         \"talend_role_2\",\n         \"talend_role_3\"\n      ]\n   },\n   {\n      \"name\":\"role_2\",\n      \"roles\":[\n         \"talend_role_4\",\n         \"talend_role_5\"\n      ]\n   }\n]"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/429TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/500InternalServerError"
          }
        }
      },
      "post": {
        "summary": "Create or replace all the role mappings",
        "description": "Create or replace all the role mappings for your tenant.",
        "responses": {
          "200": {
            "description": "Status 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleMapping"
                },
                "example": "[\n   {\n      \"name\":\"role_1\",\n      \"roles\":[\n         \"talend_role_1\",\n         \"talend_role_2\",\n         \"talend_role_3\"\n      ]\n   },\n   {\n      \"name\":\"role_2\",\n      \"roles\":[\n         \"talend_role_4\",\n         \"talend_role_5\"\n      ]\n   }\n]"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/401Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/429TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/500InternalServerError"
          }
        }
      },
      "delete": {
        "summary": "Delete all the role mappings",
        "description": "Delete all the role mappings for your tenant.\n\nThis action will disable the role mapping feature for your tenant.",
        "responses": {
          "204": {
            "description": "Status 204"
          },
          "401": {
            "$ref": "#/components/responses/401Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/429TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/500InternalServerError"
          }
        }
      }
    },
    "/security/role-mappings/{customerRoleName}": {
      "summary": "Operations on a specific role mapping",
      "description": "A role mapping can be targeted specifically using the customer role name to retrieve or delete it. ",
      "get": {
        "summary": "Get a specific role mapping",
        "description": "Get a specific role mapping for your tenant.",
        "responses": {
          "200": {
            "description": "Status 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleMapping"
                },
                "example": "{\n  \"name\":\"role_1\",\n  \"roles\":[\n    \"talend_role_1\",\n    \"talend_role_2\",\n    \"talend_role_3\"\n  ]\n}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404NotFound"
          },
          "429": {
            "$ref": "#/components/responses/429TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/500InternalServerError"
          }
        }
      },
      "delete": {
        "summary": "Delete a specific role mapping",
        "description": "Delete a specific role mappings for your tenant.",
        "responses": {
          "204": {
            "description": "Status 204"
          },
          "401": {
            "$ref": "#/components/responses/401Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404NotFound"
          },
          "429": {
            "$ref": "#/components/responses/429TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/500InternalServerError"
          }
        }
      },
      "parameters": [
        {
          "name": "customerRoleName",
          "in": "path",
          "required": true,
          "description": "Customer role name",
          "schema": {
            "type": "string",
            "description": "Customer role name"
          },
          "example": "role_1"
        }
      ]
    }
  },
  "components": {
    "schemas": {
      "RoleMapping": {
        "type": "object",
        "required": [
          "name",
          "roles"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Customer role name"
          },
          "roles": {
            "type": "array",
            "description": "Talend roles name",
            "items": {
              "type": "string"
            }
          }
        },
        "example": "{\n  \"name\":\"role_1\",\n  \"roles\":[\n    \"talend_role_1\",\n    \"talend_role_2\",\n    \"talend_role_3\"\n  ]\n}"
      }
    },
    "responses": {
      "401Unauthorized": {
        "description": "The system failed to authenticate the user. Either the Authorization header was missing or the provided token was incorrect."
      },
      "403Forbidden": {
        "description": "The system failed to authorize the user. The provided token was recognized but did not have the rights to perform the action. Contact your security administrator to get the appropriate rights."
      },
      "400BadRequest": {
        "description": "Invalid request body. The message varies depending on the cause of the bad request. For example, the cause could be a malformed body or parameter."
      },
      "404NotFound": {
        "description": "Resource not found."
      },
      "429TooManyRequests": {
        "description": "Too many requests were sent. Check the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers."
      },
      "500InternalServerError": {
        "description": "The server encountered an unexpected condition that prevented it from fulfilling the request."
      }
    },
    "securitySchemes": {
      "Public": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Bearer <TOKEN>"
      }
    }
  }
}