# Admin

## Get all admin users of the contract

> You can retrieve a complete list of admin users of the contract

```json
{"openapi":"3.0.1","info":{"title":"Reseller API","version":"2.0"},"tags":[{"name":"Admin"}],"servers":[{"url":"/reseller/v2"}],"security":[{"BasicAuthentication":[]},{"TokenAuthentication":[]}],"components":{"securitySchemes":{"BasicAuthentication":{"type":"http","description":"You will need to base64 encode the string containing your credentials. <div style=\"padding: 15px; border: 1px solid #d1ecf1; background-color: #d1ecf1; color: #0c5460; margin-bottom: 15px;\">\n  <strong>Note:</strong><br/><br/>\n   <ul><li><b>Basic Authentication</b> is supported only when <b>2-Factor \n  Authentication</b> is not configured.</li>\n  <li>Users with <b>2-Factor \n  Authentication</b> activated must generate new 2FA-secured tokens in the DCD using [Token Manager](https://docs.ionos.com/cloud/set-up-ionos-cloud/management/identity-access-management/token-manager). \n  These tokens do not inherit the <b>2FA-secured</b> property by default.</li><li>Token deletion is only possible using the <b>Token Manager</b>.</li>\n</div> Separate your username and password with a colon, i.e., username:password and send it as 'Authorization' request header. More details: https://en.wikipedia.org/wiki/Basic_access_authentication\n","scheme":"basic"},"TokenAuthentication":{"type":"apiKey","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.","name":"Authorization","in":"header"}},"schemas":{"UserResponseResource":{"type":"object","properties":{"id":{"type":"string","description":"The resource's unique identifier","readOnly":true},"href":{"type":"string","description":"URI for specific Admin in a Contract","format":"uri","readOnly":true},"firstName":{"type":"string","description":"first name of the user","readOnly":true},"lastName":{"type":"string","description":"last name of the user","readOnly":true},"email":{"type":"string","description":"email of the user","readOnly":true}}},"ErrorResponse":{"type":"object","properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation.","readOnly":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}}},"ErrorMessage":{"type":"object","properties":{"errorCode":{"type":"string","description":"IONOS Cloud error code."},"message":{"type":"string","description":"Limit must not exceed 5,000."}}}}},"paths":{"/contracts/{contractNumber}/admins":{"get":{"tags":["Admin"],"summary":"Get all admin users of the contract","description":"You can retrieve a complete list of admin users of the contract","operationId":"findAllAdmins","parameters":[{"name":"contractNumber","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserResponseResource"}}}}},"default":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /contracts/{contractNumber}/admins

> Create new admin user for contract

```json
{"openapi":"3.0.1","info":{"title":"Reseller API","version":"2.0"},"tags":[{"name":"Admin"}],"servers":[{"url":"/reseller/v2"}],"security":[{"BasicAuthentication":[]},{"TokenAuthentication":[]}],"components":{"securitySchemes":{"BasicAuthentication":{"type":"http","description":"You will need to base64 encode the string containing your credentials. <div style=\"padding: 15px; border: 1px solid #d1ecf1; background-color: #d1ecf1; color: #0c5460; margin-bottom: 15px;\">\n  <strong>Note:</strong><br/><br/>\n   <ul><li><b>Basic Authentication</b> is supported only when <b>2-Factor \n  Authentication</b> is not configured.</li>\n  <li>Users with <b>2-Factor \n  Authentication</b> activated must generate new 2FA-secured tokens in the DCD using [Token Manager](https://docs.ionos.com/cloud/set-up-ionos-cloud/management/identity-access-management/token-manager). \n  These tokens do not inherit the <b>2FA-secured</b> property by default.</li><li>Token deletion is only possible using the <b>Token Manager</b>.</li>\n</div> Separate your username and password with a colon, i.e., username:password and send it as 'Authorization' request header. More details: https://en.wikipedia.org/wiki/Basic_access_authentication\n","scheme":"basic"},"TokenAuthentication":{"type":"apiKey","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.","name":"Authorization","in":"header"}},"schemas":{"UserRequestResource":{"required":["email","firstName","lastName","password"],"type":"object","properties":{"firstName":{"type":"string","description":"first name of the user"},"lastName":{"type":"string","description":"last name of the user"},"email":{"type":"string","description":"email of the user"},"password":{"type":"string","description":"password of the user"}}},"UserResponseResource":{"type":"object","properties":{"id":{"type":"string","description":"The resource's unique identifier","readOnly":true},"href":{"type":"string","description":"URI for specific Admin in a Contract","format":"uri","readOnly":true},"firstName":{"type":"string","description":"first name of the user","readOnly":true},"lastName":{"type":"string","description":"last name of the user","readOnly":true},"email":{"type":"string","description":"email of the user","readOnly":true}}},"ErrorResponse":{"type":"object","properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation.","readOnly":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}}},"ErrorMessage":{"type":"object","properties":{"errorCode":{"type":"string","description":"IONOS Cloud error code."},"message":{"type":"string","description":"Limit must not exceed 5,000."}}}}},"paths":{"/contracts/{contractNumber}/admins":{"post":{"tags":["Admin"],"summary":"Create new admin user for contract","operationId":"createAdmin","parameters":[{"name":"contractNumber","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRequestResource"}}},"required":false},"responses":{"201":{"description":"Success","headers":{"Location":{"description":"URL of newly created admin user","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseResource"}}}},"default":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /contracts/{contractNumber}/admins/{adminId}

> Find admin by ID

```json
{"openapi":"3.0.1","info":{"title":"Reseller API","version":"2.0"},"tags":[{"name":"Admin"}],"servers":[{"url":"/reseller/v2"}],"security":[{"BasicAuthentication":[]},{"TokenAuthentication":[]}],"components":{"securitySchemes":{"BasicAuthentication":{"type":"http","description":"You will need to base64 encode the string containing your credentials. <div style=\"padding: 15px; border: 1px solid #d1ecf1; background-color: #d1ecf1; color: #0c5460; margin-bottom: 15px;\">\n  <strong>Note:</strong><br/><br/>\n   <ul><li><b>Basic Authentication</b> is supported only when <b>2-Factor \n  Authentication</b> is not configured.</li>\n  <li>Users with <b>2-Factor \n  Authentication</b> activated must generate new 2FA-secured tokens in the DCD using [Token Manager](https://docs.ionos.com/cloud/set-up-ionos-cloud/management/identity-access-management/token-manager). \n  These tokens do not inherit the <b>2FA-secured</b> property by default.</li><li>Token deletion is only possible using the <b>Token Manager</b>.</li>\n</div> Separate your username and password with a colon, i.e., username:password and send it as 'Authorization' request header. More details: https://en.wikipedia.org/wiki/Basic_access_authentication\n","scheme":"basic"},"TokenAuthentication":{"type":"apiKey","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.","name":"Authorization","in":"header"}},"schemas":{"UserResponseResource":{"type":"object","properties":{"id":{"type":"string","description":"The resource's unique identifier","readOnly":true},"href":{"type":"string","description":"URI for specific Admin in a Contract","format":"uri","readOnly":true},"firstName":{"type":"string","description":"first name of the user","readOnly":true},"lastName":{"type":"string","description":"last name of the user","readOnly":true},"email":{"type":"string","description":"email of the user","readOnly":true}}},"ErrorResponse":{"type":"object","properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation.","readOnly":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}}},"ErrorMessage":{"type":"object","properties":{"errorCode":{"type":"string","description":"IONOS Cloud error code."},"message":{"type":"string","description":"Limit must not exceed 5,000."}}}}},"paths":{"/contracts/{contractNumber}/admins/{adminId}":{"get":{"tags":["Admin"],"summary":"Find admin by ID","operationId":"findAdminById","parameters":[{"name":"contractNumber","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"adminId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseResource"}}}},"default":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete admin user

> This method call will remove admin user from the contract. This is a highly destructive method and must be used with caution.

```json
{"openapi":"3.0.1","info":{"title":"Reseller API","version":"2.0"},"tags":[{"name":"Admin"}],"servers":[{"url":"/reseller/v2"}],"security":[{"BasicAuthentication":[]},{"TokenAuthentication":[]}],"components":{"securitySchemes":{"BasicAuthentication":{"type":"http","description":"You will need to base64 encode the string containing your credentials. <div style=\"padding: 15px; border: 1px solid #d1ecf1; background-color: #d1ecf1; color: #0c5460; margin-bottom: 15px;\">\n  <strong>Note:</strong><br/><br/>\n   <ul><li><b>Basic Authentication</b> is supported only when <b>2-Factor \n  Authentication</b> is not configured.</li>\n  <li>Users with <b>2-Factor \n  Authentication</b> activated must generate new 2FA-secured tokens in the DCD using [Token Manager](https://docs.ionos.com/cloud/set-up-ionos-cloud/management/identity-access-management/token-manager). \n  These tokens do not inherit the <b>2FA-secured</b> property by default.</li><li>Token deletion is only possible using the <b>Token Manager</b>.</li>\n</div> Separate your username and password with a colon, i.e., username:password and send it as 'Authorization' request header. More details: https://en.wikipedia.org/wiki/Basic_access_authentication\n","scheme":"basic"},"TokenAuthentication":{"type":"apiKey","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.","name":"Authorization","in":"header"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation.","readOnly":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}}},"ErrorMessage":{"type":"object","properties":{"errorCode":{"type":"string","description":"IONOS Cloud error code."},"message":{"type":"string","description":"Limit must not exceed 5,000."}}}}},"paths":{"/contracts/{contractNumber}/admins/{adminId}":{"delete":{"tags":["Admin"],"summary":"Delete admin user","description":"This method call will remove admin user from the contract. This is a highly destructive method and must be used with caution.","operationId":"deleteAdmin","parameters":[{"name":"contractNumber","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"adminId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Partially update admin user

> You can use this method to partially update admin user properties (firstName and/or lastName and/or email)

```json
{"openapi":"3.0.1","info":{"title":"Reseller API","version":"2.0"},"tags":[{"name":"Admin"}],"servers":[{"url":"/reseller/v2"}],"security":[{"BasicAuthentication":[]},{"TokenAuthentication":[]}],"components":{"securitySchemes":{"BasicAuthentication":{"type":"http","description":"You will need to base64 encode the string containing your credentials. <div style=\"padding: 15px; border: 1px solid #d1ecf1; background-color: #d1ecf1; color: #0c5460; margin-bottom: 15px;\">\n  <strong>Note:</strong><br/><br/>\n   <ul><li><b>Basic Authentication</b> is supported only when <b>2-Factor \n  Authentication</b> is not configured.</li>\n  <li>Users with <b>2-Factor \n  Authentication</b> activated must generate new 2FA-secured tokens in the DCD using [Token Manager](https://docs.ionos.com/cloud/set-up-ionos-cloud/management/identity-access-management/token-manager). \n  These tokens do not inherit the <b>2FA-secured</b> property by default.</li><li>Token deletion is only possible using the <b>Token Manager</b>.</li>\n</div> Separate your username and password with a colon, i.e., username:password and send it as 'Authorization' request header. More details: https://en.wikipedia.org/wiki/Basic_access_authentication\n","scheme":"basic"},"TokenAuthentication":{"type":"apiKey","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.","name":"Authorization","in":"header"}},"schemas":{"UserUpdateRequestResource":{"required":["email","firstName","lastName"],"type":"object","properties":{"firstName":{"type":"string","description":"first name of the user"},"lastName":{"type":"string","description":"last name of the user"},"email":{"type":"string","description":"email of the user"}}},"UserResponseResource":{"type":"object","properties":{"id":{"type":"string","description":"The resource's unique identifier","readOnly":true},"href":{"type":"string","description":"URI for specific Admin in a Contract","format":"uri","readOnly":true},"firstName":{"type":"string","description":"first name of the user","readOnly":true},"lastName":{"type":"string","description":"last name of the user","readOnly":true},"email":{"type":"string","description":"email of the user","readOnly":true}}},"ErrorResponse":{"type":"object","properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation.","readOnly":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}}},"ErrorMessage":{"type":"object","properties":{"errorCode":{"type":"string","description":"IONOS Cloud error code."},"message":{"type":"string","description":"Limit must not exceed 5,000."}}}}},"paths":{"/contracts/{contractNumber}/admins/{adminId}":{"patch":{"tags":["Admin"],"summary":"Partially update admin user","description":"You can use this method to partially update admin user properties (firstName and/or lastName and/or email)","operationId":"updateAdmin","parameters":[{"name":"contractNumber","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"adminId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdateRequestResource"}}},"required":false},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseResource"}}}},"default":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
