> For AI agents: [llms.txt](https://docs.trustedauth.com/llms.txt) provides a Markdown index of this documentation.

# Create Admin API application

`POST /api/web/v1/applications/adminapi`

Create an Admin API application. Caller requires the APPLICATIONS:ADD permission.

## Request Body

Required.

### application/json

Schema

```json
{
  "required": [
    "name"
  ],
  "type": "object",
  "properties": {
    "allowLongLivedToken": {
      "type": "boolean",
      "description": "Determines if a long-lived token is allowed in this application.",
      "example": true
    },
    "applicationTemplateId": {
      "type": "string",
      "description": "The UUID of the application template.  This value is only used when creating a new application. If not specified, the default admininstration API template is used.",
      "example": "53df23b1-5f57-sdc5-tr23-asd345ip6789"
    },
    "description": {
      "type": "string",
      "description": "Short description of application.",
      "example": "application for testing"
    },
    "ipListId": {
      "type": "string",
      "description": "The UUID of the IP Addresses list.",
      "example": "828c4359-b367-4ac9-b164-eebc18664027"
    },
    "logo": {
      "type": "string",
      "description": "Base64 encoded logo image."
    },
    "name": {
      "type": "string",
      "description": "Name of application. ",
      "example": "adminApiApplication"
    },
    "roleId": {
      "type": "string",
      "description": "The UUID of the Site role to be associated with the API application. Pass an empty string value to unset the site role. Either this value or spRoleId is required when creating the application.",
      "example": "53df23b1-5f57-sdc5-tr23-asd345ip6789"
    },
    "spRoleId": {
      "type": "string",
      "description": "The UUID of the service provider role to be associated with the API application. Pass an empty string to unset the service provider role. Either this value or roleId is required when creating the application.",
      "example": "53df23b1-5f57-sdc5-tr23-asd345ip6788"
    }
  },
  "description": "Parameters for the new application.",
  "title": "AdminApiApplicationParms"
}
```

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "required": [
    "applicationTemplate",
    "name"
  ],
  "type": "object",
  "properties": {
    "allowLongLivedToken": {
      "type": "boolean",
      "description": "Determines if the application can use a long-lived token for authentication.",
      "example": true
    },
    "applicationTemplate": {
      "type": "string",
      "description": "The name of the application template specific to this application type.",
      "example": "Administration API"
    },
    "applicationTemplateId": {
      "type": "string",
      "description": "Application template id specific to this application type.",
      "example": "00dc1d40-b512-4159-bccc-e8c1b4524515"
    },
    "description": {
      "type": "string",
      "description": "Short description of application.",
      "example": "application for testing"
    },
    "id": {
      "type": "string",
      "description": "Application ID.",
      "example": "6781549d-433c-44ea-a42f-4705c26f3245"
    },
    "ipListId": {
      "type": "string",
      "description": "The UUID of the IP Addresses list.",
      "example": "828c4359-b367-4ac9-b164-eebc18664027"
    },
    "lastAuthnDate": {
      "type": "string",
      "description": "Last successful authentication time to use administration api",
      "format": "date-time",
      "example": "2019-02-19T13:15:27Z"
    },
    "logo": {
      "type": "string",
      "description": "Base64 encoded logo image."
    },
    "name": {
      "type": "string",
      "description": "Name of application. ",
      "example": "adminApiApplication"
    },
    "roleId": {
      "type": "string",
      "description": "The UUID of the Site role to be associated with the API application. Pass an empty string value to unset the site role.",
      "example": "53df23b1-5f57-sdc5-tr23-asd345ip6789"
    },
    "sharedSecret": {
      "type": "string",
      "description": "Shared secret for application."
    },
    "spRoleId": {
      "type": "string",
      "description": "The UUID of the service provider role to be associated with the API application. Pass an empty string to unset the service provider role.",
      "example": "53df23b1-5f57-sdc5-tr23-asd345ip6788"
    }
  },
  "description": "Information returned when an Admin API application is fetched from Identity as a Service.",
  "title": "AdminApiApplication"
}
```

### 400

Bad Request

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 401

Access denied

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 403

Forbidden

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 404

Not Found

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 409

Conflict

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

## Security

Requirements

```json
[
  {
    "AdminAPIAuthentication": [
      "APPLICATIONS:ADD"
    ]
  }
]
```
