> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/infrastructure-as-code-management/iacm-api-reference/ansible/import-ansible-static-inventory-from-yaml-ini.md).

# Import Ansible static inventory from YAML/INI

Create a new static (manual) Ansible inventory by parsing YAML or INI content.

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"ansible","description":"Ansible Service handles the API for ansible entities."}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/ansible/inventory/import":{"post":{"tags":["ansible"],"summary":"Import Ansible static inventory from YAML/INI","description":"Create a new static (manual) Ansible inventory by parsing YAML or INI content.","operationId":"ansible#import-inventory","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportInventoryRequest2"}}}},"responses":{"201":{"description":"Created response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportInventoryResponse"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}}}}}},"components":{"schemas":{"ImportInventoryRequest2":{"type":"object","properties":{"content":{"type":"string","description":"Raw inventory content as a string (paste or client-read file).","minLength":1,"maxLength":1048576},"format":{"type":"string","description":"Source format of the content.","enum":["yaml","ini"]},"identifier":{"type":"string","description":"The identifier of the new inventory.","minLength":1,"maxLength":128},"name":{"type":"string","description":"Display name of the new inventory.","minLength":1,"maxLength":128},"tags":{"type":"array","items":{"type":"string"},"description":"Optional tags to apply to the new inventory."}},"required":["identifier","name","format","content"]},"ImportInventoryResponse":{"type":"object","properties":{"inventory":{"$ref":"#/components/schemas/HarnessIacmInventory"},"warnings":{"type":"array","items":{"type":"string"},"description":"Warnings surfaced during import (lossy conversions, flattened groups, etc.)."}},"required":["inventory","warnings"]},"HarnessIacmInventory":{"type":"object","properties":{"account":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128},"created":{"type":"integer","description":"Timestamp when the resource was created.","format":"int64"},"description":{"type":"string","description":"Description documents the inventory purpose and usage","maxLength":1024},"identifier":{"type":"string","description":"The unique identifier for this inventory"},"name":{"type":"string","description":"Name is the human readable name","minLength":1,"maxLength":1024},"org":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128},"project":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128},"tags":{"type":"array","items":{"type":"string"},"description":"Tags associated with the inventory"},"type":{"type":"string","description":"Type indicates what kind of inventory this is","enum":["manual","dynamic","plugin","remote"]},"updated":{"type":"integer","description":"Timestamp when the resource was last updated.","format":"int64"}},"required":["created","updated","account","org","project","identifier","name","type","data"]},"AnsibleError":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?"},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem."},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem."},"name":{"type":"string","description":"Name is the name of this class of errors."},"temporary":{"type":"boolean","description":"Is the error temporary?"},"timeout":{"type":"boolean","description":"Is the error a timeout?"}},"required":["name","id","message","temporary","timeout","fault"]}}}}
```
