# LDAPProviders

## Authorize an LDAP provider and retrieve a token

> Authorizes the LDAP provider by slug and returns an authorization token.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"parameters":{"slug_path":{"name":"slug","in":"path","description":"The slug of the resource.","required":true,"schema":{"type":"string"}}},"responses":{"400":{"description":"Required field(s) are missing, data is invalid, or the action is not allowed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field":{"oneOf":[{"type":"array","description":"Indicates that no value was provided for the {field} field in the request.","items":{"type":"string"}},{"type":"array","description":"Indicates usage of a non-existent object for {field} in the request.","items":{"type":"string"}}]},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"non_field_errors":{"description":"Indicates invalid data or action usage in the request.","type":"array","items":{"type":"string"}},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"detail":{"description":"Provides a detailed message for the given error.","type":"string"},"code":{"type":"string","description":"Represents the server-side error code."}}}]}}}},"403":{"description":"Forbidden"},"404":{"description":"The given resource or object was not found or does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"description":"Contains a detailed description of the error.","type":"string"}}}}}}}},"paths":{"/api/v1/ldap/{slug}/authorize/":{"post":{"tags":["LDAPProviders"],"summary":"Authorize an LDAP provider and retrieve a token","description":"Authorizes the LDAP provider by slug and returns an authorization token.","parameters":[{"$ref":"#/components/parameters/slug_path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"Username to authorize"},"password":{"type":"string","description":"Password for the given username"}}}}}},"responses":{"200":{"description":"Authorization successful, returns the token.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Authorization token returned after a successful login."}}}}}},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"}}}}}}
```

## Retrieve LDAP provider

> Retrieve details for a specific LDAP provider by slug.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"parameters":{"slug_path":{"name":"slug","in":"path","description":"The slug of the resource.","required":true,"schema":{"type":"string"}}},"schemas":{"LDAPProvider":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"LDAP Provider ID"},"name":{"type":"string","maxLength":256,"description":"Name of the LDAP provider."},"slug":{"type":"string","maxLength":256,"description":"Unique slug for the LDAP provider."},"icon":{"type":"string","format":"binary","description":"Icon for the LDAP provider."},"host":{"type":"string","format":"url","description":"Host URL for the LDAP provider."},"port":{"type":"integer","description":"Port number to connect to the LDAP server.","maximum":65535},"use_ssl":{"type":"boolean","description":"Indicates whether SSL is used for the LDAP connection."},"bind_dn":{"type":"string","maxLength":256,"description":"The distinguished name (DN) for binding to the LDAP server."},"bind_password":{"type":"string","maxLength":512,"description":"Password for the LDAP bind user."},"base_dn":{"type":"string","maxLength":256,"description":"The base distinguished name (DN) for LDAP searches."},"attribute_map":{"type":"object","description":"A mapping of LDAP attributes to system fields."},"is_active":{"type":"boolean","description":"Indicates if the LDAP provider is active."}}}},"responses":{"404":{"description":"The given resource or object was not found or does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"description":"Contains a detailed description of the error.","type":"string"}}}}}},"500":{"description":"Server Error"}}},"paths":{"/api/v1/ldap/{slug}/":{"get":{"summary":"Retrieve LDAP provider","description":"Retrieve details for a specific LDAP provider by slug.","tags":["LDAPProviders"],"parameters":[{"$ref":"#/components/parameters/slug_path"}],"responses":{"200":{"description":"LDAP provider details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LDAPProvider"}}}},"404":{"$ref":"#/components/responses/404"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Update LDAP provider

> Update an existing LDAP provider. Only superusers can perform this action.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"parameters":{"slug_path":{"name":"slug","in":"path","description":"The slug of the resource.","required":true,"schema":{"type":"string"}}},"schemas":{"LDAPProvider":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"LDAP Provider ID"},"name":{"type":"string","maxLength":256,"description":"Name of the LDAP provider."},"slug":{"type":"string","maxLength":256,"description":"Unique slug for the LDAP provider."},"icon":{"type":"string","format":"binary","description":"Icon for the LDAP provider."},"host":{"type":"string","format":"url","description":"Host URL for the LDAP provider."},"port":{"type":"integer","description":"Port number to connect to the LDAP server.","maximum":65535},"use_ssl":{"type":"boolean","description":"Indicates whether SSL is used for the LDAP connection."},"bind_dn":{"type":"string","maxLength":256,"description":"The distinguished name (DN) for binding to the LDAP server."},"bind_password":{"type":"string","maxLength":512,"description":"Password for the LDAP bind user."},"base_dn":{"type":"string","maxLength":256,"description":"The base distinguished name (DN) for LDAP searches."},"attribute_map":{"type":"object","description":"A mapping of LDAP attributes to system fields."},"is_active":{"type":"boolean","description":"Indicates if the LDAP provider is active."}}}},"responses":{"400":{"description":"Required field(s) are missing, data is invalid, or the action is not allowed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field":{"oneOf":[{"type":"array","description":"Indicates that no value was provided for the {field} field in the request.","items":{"type":"string"}},{"type":"array","description":"Indicates usage of a non-existent object for {field} in the request.","items":{"type":"string"}}]},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"non_field_errors":{"description":"Indicates invalid data or action usage in the request.","type":"array","items":{"type":"string"}},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"detail":{"description":"Provides a detailed message for the given error.","type":"string"},"code":{"type":"string","description":"Represents the server-side error code."}}}]}}}},"403":{"description":"Forbidden"},"500":{"description":"Server Error"}}},"paths":{"/api/v1/ldap/{slug}/":{"put":{"summary":"Update LDAP provider","description":"Update an existing LDAP provider. Only superusers can perform this action.","tags":["LDAPProviders"],"parameters":[{"$ref":"#/components/parameters/slug_path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LDAPProvider"}}},"description":"LDAP provider object to update."},"responses":{"200":{"description":"LDAP provider updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LDAPProvider"}}}},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Delete LDAP provider

> Delete an existing LDAP provider. Only superusers can perform this action.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"parameters":{"slug_path":{"name":"slug","in":"path","description":"The slug of the resource.","required":true,"schema":{"type":"string"}}},"responses":{"204":{"description":"No content"},"403":{"description":"Forbidden"},"404":{"description":"The given resource or object was not found or does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"description":"Contains a detailed description of the error.","type":"string"}}}}}},"500":{"description":"Server Error"}}},"paths":{"/api/v1/ldap/{slug}/":{"delete":{"summary":"Delete LDAP provider","description":"Delete an existing LDAP provider. Only superusers can perform this action.","tags":["LDAPProviders"],"parameters":[{"$ref":"#/components/parameters/slug_path"}],"responses":{"204":{"$ref":"#/components/responses/204"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## List LDAP providers

> Retrieve a list of all LDAP providers. Non-superusers only can see active providers.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"LDAPProvider":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"LDAP Provider ID"},"name":{"type":"string","maxLength":256,"description":"Name of the LDAP provider."},"slug":{"type":"string","maxLength":256,"description":"Unique slug for the LDAP provider."},"icon":{"type":"string","format":"binary","description":"Icon for the LDAP provider."},"host":{"type":"string","format":"url","description":"Host URL for the LDAP provider."},"port":{"type":"integer","description":"Port number to connect to the LDAP server.","maximum":65535},"use_ssl":{"type":"boolean","description":"Indicates whether SSL is used for the LDAP connection."},"bind_dn":{"type":"string","maxLength":256,"description":"The distinguished name (DN) for binding to the LDAP server."},"bind_password":{"type":"string","maxLength":512,"description":"Password for the LDAP bind user."},"base_dn":{"type":"string","maxLength":256,"description":"The base distinguished name (DN) for LDAP searches."},"attribute_map":{"type":"object","description":"A mapping of LDAP attributes to system fields."},"is_active":{"type":"boolean","description":"Indicates if the LDAP provider is active."}}}},"responses":{"500":{"description":"Server Error"}}},"paths":{"/api/v1/ldap/":{"get":{"summary":"List LDAP providers","description":"Retrieve a list of all LDAP providers. Non-superusers only can see active providers.","tags":["LDAPProviders"],"responses":{"200":{"description":"List of LDAP providers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LDAPProvider"}}}}},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Create LDAP provider

> Create a new LDAP provider. Only superusers can perform this action.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"LDAPProvider":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"LDAP Provider ID"},"name":{"type":"string","maxLength":256,"description":"Name of the LDAP provider."},"slug":{"type":"string","maxLength":256,"description":"Unique slug for the LDAP provider."},"icon":{"type":"string","format":"binary","description":"Icon for the LDAP provider."},"host":{"type":"string","format":"url","description":"Host URL for the LDAP provider."},"port":{"type":"integer","description":"Port number to connect to the LDAP server.","maximum":65535},"use_ssl":{"type":"boolean","description":"Indicates whether SSL is used for the LDAP connection."},"bind_dn":{"type":"string","maxLength":256,"description":"The distinguished name (DN) for binding to the LDAP server."},"bind_password":{"type":"string","maxLength":512,"description":"Password for the LDAP bind user."},"base_dn":{"type":"string","maxLength":256,"description":"The base distinguished name (DN) for LDAP searches."},"attribute_map":{"type":"object","description":"A mapping of LDAP attributes to system fields."},"is_active":{"type":"boolean","description":"Indicates if the LDAP provider is active."}}}},"responses":{"400":{"description":"Required field(s) are missing, data is invalid, or the action is not allowed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field":{"oneOf":[{"type":"array","description":"Indicates that no value was provided for the {field} field in the request.","items":{"type":"string"}},{"type":"array","description":"Indicates usage of a non-existent object for {field} in the request.","items":{"type":"string"}}]},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"non_field_errors":{"description":"Indicates invalid data or action usage in the request.","type":"array","items":{"type":"string"}},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"detail":{"description":"Provides a detailed message for the given error.","type":"string"},"code":{"type":"string","description":"Represents the server-side error code."}}}]}}}},"403":{"description":"Forbidden"},"500":{"description":"Server Error"}}},"paths":{"/api/v1/ldap/":{"post":{"summary":"Create LDAP provider","description":"Create a new LDAP provider. Only superusers can perform this action.","tags":["LDAPProviders"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LDAPProvider"}}},"description":"LDAP provider object to create."},"responses":{"201":{"description":"LDAP provider created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LDAPProvider"}}}},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"500":{"$ref":"#/components/responses/500"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/omnitron-openapis/ldapproviders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
