{"openapi":"3.1.0","info":{"title":"IntoSQL API","version":"1.0.0","description":"Convert spreadsheets, CSV and JSON into SQL on IntoSQL's machines. Open a conversion, upload the file to the address it gives, start it, then read the result. Files are deleted after 24 hours. Every answer carries an `X-Request-Id`. Within v1, changes only add (fields, codes, endpoints); anything removed is announced with `Deprecation` and `Sunset` headers first. Part of IntoSQL Pro.","contact":{"name":"IntoSQL","url":"https://intosql.com/contact"}},"servers":[{"url":"https://intosql.com/api/v1"}],"security":[{"apiKey":[]}],"paths":{"/conversions":{"get":{"operationId":"listConversions","summary":"List conversions","description":"Newest first. Pass `meta.next_cursor` as `cursor` for the next page.","parameters":[{"name":"limit","in":"query","required":false,"description":"Conversions per page, 1 to 100. 50 when absent.","schema":{"type":"integer"}},{"name":"status","in":"query","required":false,"description":"Only conversions in this status: `awaiting_upload`, `queued`, `running`, `done`, `failed`, `canceled`.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"The `meta.next_cursor` of the page before.","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of conversions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionPage"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"`limit` or `status` isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"No API key, or not a valid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"402":{"description":"No Pro plan (`needs_pro`), or this month's conversions are used up (`over_quota`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The key can't use conversions, or the account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"405":{"description":"The path doesn't take this method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"More than 120 requests a minute with this key (`rate_limited`), or, when opening or starting a conversion, five already queued or running (`too_many_active`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}}},"x-codeSamples":[{"lang":"shell","label":"curl","source":"curl -X GET https://intosql.com/api/v1/conversions \\\n  -H \"Authorization: Bearer $INTOSQL_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { IntoSQL, spec } from '@intosql/sdk';\n\nconst intosql = new IntoSQL({ apiKey: process.env.INTOSQL_API_KEY! });\n\nfor await (const conversion of intosql.conversions.list()) {\n    console.log(conversion.name, conversion.status);\n}"},{"lang":"php","label":"PHP","source":"use IntoSQL\\IntoSQL;\nuse IntoSQL\\Spec;\n\n$intosql = new IntoSQL(apiKey: getenv('INTOSQL_API_KEY'));\n\nforeach ($intosql->conversions->list() as $conversion) {\n    echo $conversion->name, ' ', $conversion->status->value, PHP_EOL;\n}"},{"lang":"python","label":"Python","source":"import os\nfrom intosql import IntoSQL, spec\n\nintosql = IntoSQL(os.environ[\"INTOSQL_API_KEY\"])\n\nfor conversion in intosql.conversions.list():\n    print(conversion[\"name\"], conversion[\"status\"])"},{"lang":"java","label":"Java","source":"IntoSQL intosql = new IntoSQL(System.getenv(\"INTOSQL_API_KEY\"));\n\nfor (Conversion conversion : intosql.conversions().list()) {\n    System.out.println(conversion.getName() + \" \" + conversion.getStatus());\n}"},{"lang":"go","label":"Go","source":"client, err := intosql.NewClient(os.Getenv(\"INTOSQL_API_KEY\"))\nctx := context.Background()\n\nit := client.Conversions.List(ctx, intosql.ListParams{})\nfor it.Next() {\n\tfmt.Println(it.Current().Name, it.Current().Status)\n}\nerr = it.Err()"},{"lang":"csharp","label":"C#","source":"using IntoSQL;\n\nvar client = new IntoSQLClient(Environment.GetEnvironmentVariable(\"INTOSQL_API_KEY\")!);\n\nawait foreach (var conversion in client.Conversions.ListAsync())\n{\n    Console.WriteLine($\"{conversion.Name} {conversion.Status}\");\n}"},{"lang":"ruby","label":"Ruby","source":"require \"intosql\"\n\nintosql = IntoSQL::Client.new(api_key: ENV.fetch(\"INTOSQL_API_KEY\"))\n\nintosql.conversions.list.each do |conversion|\n  puts \"#{conversion.name} #{conversion.status}\"\nend"}]},"post":{"operationId":"createConversion","summary":"Open a conversion","description":"Send `name` and `bytes` to upload the file yourself, up to 5 GiB: the answer has an address to `PUT` it to, valid for an hour. Or send `url`, a public HTTPS address of a file up to 50 GiB: it is downloaded and converted right away, and the answer is `202`.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","description":"The file's name, with its extension."},"bytes":{"type":"integer","minimum":1},"spec":{"$ref":"#/components/schemas/JobSpec"}},"required":["name","bytes","spec"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"name":{"type":"string","description":"The file's name, when its address doesn't give one."},"spec":{"$ref":"#/components/schemas/JobSpec"}},"required":["url","spec"]}]},"example":{"name":"ventas.csv","bytes":1048576,"spec":{"output":{"dialect":"postgresql"}}}}}},"responses":{"201":{"description":"The conversion, with its upload address.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversion"}},"required":["data"]}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"202":{"description":"The conversion of the file at `url`, queued.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversion"}},"required":["data"]}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"409":{"description":"A request with the same `Idempotency-Key` is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The file is larger than a conversion takes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"Missing fields, an invalid `spec`, a `url` that isn't public HTTPS, or an `Idempotency-Key` reused for another request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"No API key, or not a valid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"402":{"description":"No Pro plan (`needs_pro`), or this month's conversions are used up (`over_quota`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The key can't use conversions, or the account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"405":{"description":"The path doesn't take this method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"More than 120 requests a minute with this key (`rate_limited`), or, when opening or starting a conversion, five already queued or running (`too_many_active`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}}},"x-codeSamples":[{"lang":"shell","label":"curl","source":"curl -X POST https://intosql.com/api/v1/conversions \\\n  -H \"Authorization: Bearer $INTOSQL_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n      \"name\": \"ventas.csv\",\n      \"bytes\": 1048576,\n      \"spec\": {\n          \"output\": {\n              \"dialect\": \"postgresql\"\n          }\n      }\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { IntoSQL, spec } from '@intosql/sdk';\n\nconst intosql = new IntoSQL({ apiKey: process.env.INTOSQL_API_KEY! });\n\nconst conversion = await intosql.conversions.create({\n    name: 'ventas.csv',\n    bytes: 1048576,\n    spec: spec({ dialect: 'postgresql' }),\n});\nawait intosql.conversions.upload(conversion, file);"},{"lang":"php","label":"PHP","source":"use IntoSQL\\IntoSQL;\nuse IntoSQL\\Spec;\n\n$intosql = new IntoSQL(apiKey: getenv('INTOSQL_API_KEY'));\n\n$conversion = $intosql->conversions->create('ventas.csv', filesize('ventas.csv'), Spec::make(dialect: 'postgresql'));\n$intosql->conversions->upload($conversion, 'ventas.csv');"},{"lang":"python","label":"Python","source":"import os\nfrom intosql import IntoSQL, spec\n\nintosql = IntoSQL(os.environ[\"INTOSQL_API_KEY\"])\n\nconversion = intosql.conversions.create(\n    name=\"ventas.csv\",\n    size=os.path.getsize(\"ventas.csv\"),\n    spec=spec(\"postgresql\"),\n)\nintosql.conversions.upload(conversion, \"ventas.csv\")"},{"lang":"java","label":"Java","source":"IntoSQL intosql = new IntoSQL(System.getenv(\"INTOSQL_API_KEY\"));\n\nPath file = Path.of(\"ventas.csv\");\nConversion conversion = intosql.conversions().create(\"ventas.csv\", Files.size(file), Spec.of(Dialect.POSTGRESQL));\nintosql.conversions().upload(conversion, Upload.of(file));"},{"lang":"go","label":"Go","source":"client, err := intosql.NewClient(os.Getenv(\"INTOSQL_API_KEY\"))\nctx := context.Background()\n\nfile, err := os.Open(\"ventas.csv\")\ninfo, err := file.Stat()\nconversion, err := client.Conversions.Create(ctx, intosql.CreateParams{\n\tName:  \"ventas.csv\",\n\tBytes: info.Size(),\n\tSpec:  intosql.NewSpec(intosql.SpecOptions{Dialect: intosql.DialectPostgreSQL}),\n})\nerr = client.Conversions.Upload(ctx, conversion, file, info.Size())"},{"lang":"csharp","label":"C#","source":"using IntoSQL;\n\nvar client = new IntoSQLClient(Environment.GetEnvironmentVariable(\"INTOSQL_API_KEY\")!);\n\nvar file = Upload.FromFile(\"ventas.csv\");\nvar conversion = await client.Conversions.CreateAsync(\"ventas.csv\", file.Bytes, JobSpec.Create(Dialect.PostgreSql));\nawait client.Conversions.UploadAsync(conversion, file);"},{"lang":"ruby","label":"Ruby","source":"require \"intosql\"\n\nintosql = IntoSQL::Client.new(api_key: ENV.fetch(\"INTOSQL_API_KEY\"))\n\nconversion = intosql.conversions.create(\n  name: \"ventas.csv\",\n  bytes: File.size(\"ventas.csv\"),\n  spec: IntoSQL.spec(dialect: \"postgresql\")\n)\nintosql.conversions.upload(conversion, \"ventas.csv\")"}]}},"/conversions/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getConversion","summary":"Read a conversion","description":"When `status` is `done`, `output.url` downloads the result for ten minutes; read the conversion again for a fresh address. When it is `failed`, `error` says why.","responses":{"200":{"description":"The conversion.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversion"}},"required":["data"]}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"No conversion with that id on this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"No API key, or not a valid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"402":{"description":"No Pro plan (`needs_pro`), or this month's conversions are used up (`over_quota`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The key can't use conversions, or the account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"405":{"description":"The path doesn't take this method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"More than 120 requests a minute with this key (`rate_limited`), or, when opening or starting a conversion, five already queued or running (`too_many_active`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}}},"x-codeSamples":[{"lang":"shell","label":"curl","source":"curl -X GET https://intosql.com/api/v1/conversions/01J9Z8K3M4N5P6Q7R8S9T0V1W2 \\\n  -H \"Authorization: Bearer $INTOSQL_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { IntoSQL, spec } from '@intosql/sdk';\n\nconst intosql = new IntoSQL({ apiKey: process.env.INTOSQL_API_KEY! });\n\nconst conversion = await intosql.conversions.retrieve('01J9Z8K3M4N5P6Q7R8S9T0V1W2');"},{"lang":"php","label":"PHP","source":"use IntoSQL\\IntoSQL;\nuse IntoSQL\\Spec;\n\n$intosql = new IntoSQL(apiKey: getenv('INTOSQL_API_KEY'));\n\n$conversion = $intosql->conversions->retrieve('01J9Z8K3M4N5P6Q7R8S9T0V1W2');"},{"lang":"python","label":"Python","source":"import os\nfrom intosql import IntoSQL, spec\n\nintosql = IntoSQL(os.environ[\"INTOSQL_API_KEY\"])\n\nconversion = intosql.conversions.retrieve(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"},{"lang":"java","label":"Java","source":"IntoSQL intosql = new IntoSQL(System.getenv(\"INTOSQL_API_KEY\"));\n\nConversion conversion = intosql.conversions().retrieve(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\");"},{"lang":"go","label":"Go","source":"client, err := intosql.NewClient(os.Getenv(\"INTOSQL_API_KEY\"))\nctx := context.Background()\n\nconversion, err := client.Conversions.Retrieve(ctx, \"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"},{"lang":"csharp","label":"C#","source":"using IntoSQL;\n\nvar client = new IntoSQLClient(Environment.GetEnvironmentVariable(\"INTOSQL_API_KEY\")!);\n\nvar conversion = await client.Conversions.RetrieveAsync(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\");"},{"lang":"ruby","label":"Ruby","source":"require \"intosql\"\n\nintosql = IntoSQL::Client.new(api_key: ENV.fetch(\"INTOSQL_API_KEY\"))\n\nconversion = intosql.conversions.retrieve(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"}]},"delete":{"operationId":"deleteConversion","summary":"Delete a conversion","description":"Deletes its files now instead of after 24 hours. A conversion deleted while it runs sends no webhook.","responses":{"204":{"description":"Deleted.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"No conversion with that id on this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"No API key, or not a valid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"402":{"description":"No Pro plan (`needs_pro`), or this month's conversions are used up (`over_quota`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The key can't use conversions, or the account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"405":{"description":"The path doesn't take this method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"More than 120 requests a minute with this key (`rate_limited`), or, when opening or starting a conversion, five already queued or running (`too_many_active`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}}},"x-codeSamples":[{"lang":"shell","label":"curl","source":"curl -X DELETE https://intosql.com/api/v1/conversions/01J9Z8K3M4N5P6Q7R8S9T0V1W2 \\\n  -H \"Authorization: Bearer $INTOSQL_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { IntoSQL, spec } from '@intosql/sdk';\n\nconst intosql = new IntoSQL({ apiKey: process.env.INTOSQL_API_KEY! });\n\nawait intosql.conversions.delete('01J9Z8K3M4N5P6Q7R8S9T0V1W2');"},{"lang":"php","label":"PHP","source":"use IntoSQL\\IntoSQL;\nuse IntoSQL\\Spec;\n\n$intosql = new IntoSQL(apiKey: getenv('INTOSQL_API_KEY'));\n\n$intosql->conversions->delete('01J9Z8K3M4N5P6Q7R8S9T0V1W2');"},{"lang":"python","label":"Python","source":"import os\nfrom intosql import IntoSQL, spec\n\nintosql = IntoSQL(os.environ[\"INTOSQL_API_KEY\"])\n\nintosql.conversions.delete(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"},{"lang":"java","label":"Java","source":"IntoSQL intosql = new IntoSQL(System.getenv(\"INTOSQL_API_KEY\"));\n\nintosql.conversions().delete(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\");"},{"lang":"go","label":"Go","source":"client, err := intosql.NewClient(os.Getenv(\"INTOSQL_API_KEY\"))\nctx := context.Background()\n\nerr = client.Conversions.Delete(ctx, \"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"},{"lang":"csharp","label":"C#","source":"using IntoSQL;\n\nvar client = new IntoSQLClient(Environment.GetEnvironmentVariable(\"INTOSQL_API_KEY\")!);\n\nawait client.Conversions.DeleteAsync(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\");"},{"lang":"ruby","label":"Ruby","source":"require \"intosql\"\n\nintosql = IntoSQL::Client.new(api_key: ENV.fetch(\"INTOSQL_API_KEY\"))\n\nintosql.conversions.delete(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"}]}},"/conversions/{id}/start":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"startConversion","summary":"Start a conversion","description":"Once the whole file is uploaded. The conversion is queued, then `running`, then `done` or `failed`. Don't retry `already_started`: the conversion is on its way.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255}}],"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversion"}},"required":["data"]}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"No conversion with that id on this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"409":{"description":"Already started, the file isn't uploaded whole yet, or a request with the same `Idempotency-Key` is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"No API key, or not a valid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"402":{"description":"No Pro plan (`needs_pro`), or this month's conversions are used up (`over_quota`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The key can't use conversions, or the account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"405":{"description":"The path doesn't take this method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"More than 120 requests a minute with this key (`rate_limited`), or, when opening or starting a conversion, five already queued or running (`too_many_active`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}}},"x-codeSamples":[{"lang":"shell","label":"curl","source":"curl -X POST https://intosql.com/api/v1/conversions/01J9Z8K3M4N5P6Q7R8S9T0V1W2/start \\\n  -H \"Authorization: Bearer $INTOSQL_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { IntoSQL, spec } from '@intosql/sdk';\n\nconst intosql = new IntoSQL({ apiKey: process.env.INTOSQL_API_KEY! });\n\nconst conversion = await intosql.conversions.start('01J9Z8K3M4N5P6Q7R8S9T0V1W2');"},{"lang":"php","label":"PHP","source":"use IntoSQL\\IntoSQL;\nuse IntoSQL\\Spec;\n\n$intosql = new IntoSQL(apiKey: getenv('INTOSQL_API_KEY'));\n\n$conversion = $intosql->conversions->start('01J9Z8K3M4N5P6Q7R8S9T0V1W2');"},{"lang":"python","label":"Python","source":"import os\nfrom intosql import IntoSQL, spec\n\nintosql = IntoSQL(os.environ[\"INTOSQL_API_KEY\"])\n\nconversion = intosql.conversions.start(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"},{"lang":"java","label":"Java","source":"IntoSQL intosql = new IntoSQL(System.getenv(\"INTOSQL_API_KEY\"));\n\nConversion conversion = intosql.conversions().start(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\");"},{"lang":"go","label":"Go","source":"client, err := intosql.NewClient(os.Getenv(\"INTOSQL_API_KEY\"))\nctx := context.Background()\n\nconversion, err := client.Conversions.Start(ctx, \"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"},{"lang":"csharp","label":"C#","source":"using IntoSQL;\n\nvar client = new IntoSQLClient(Environment.GetEnvironmentVariable(\"INTOSQL_API_KEY\")!);\n\nvar conversion = await client.Conversions.StartAsync(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\");"},{"lang":"ruby","label":"Ruby","source":"require \"intosql\"\n\nintosql = IntoSQL::Client.new(api_key: ENV.fetch(\"INTOSQL_API_KEY\"))\n\nconversion = intosql.conversions.start(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"}]}},"/conversions/{id}/cancel":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"cancelConversion","summary":"Cancel a conversion","description":"Stops a conversion that hasn't ended and deletes its files; it stays listed as `canceled` and doesn't count toward the month. Canceling it again answers the same. A running conversion may finish its work, but the result is thrown away.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Canceled.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversion"}},"required":["data"]}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"No conversion with that id on this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"409":{"description":"It already ended (`already_finished`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"No API key, or not a valid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"402":{"description":"No Pro plan (`needs_pro`), or this month's conversions are used up (`over_quota`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The key can't use conversions, or the account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"405":{"description":"The path doesn't take this method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"More than 120 requests a minute with this key (`rate_limited`), or, when opening or starting a conversion, five already queued or running (`too_many_active`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}}},"x-codeSamples":[{"lang":"shell","label":"curl","source":"curl -X POST https://intosql.com/api/v1/conversions/01J9Z8K3M4N5P6Q7R8S9T0V1W2/cancel \\\n  -H \"Authorization: Bearer $INTOSQL_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { IntoSQL, spec } from '@intosql/sdk';\n\nconst intosql = new IntoSQL({ apiKey: process.env.INTOSQL_API_KEY! });\n\nconst conversion = await intosql.conversions.cancel('01J9Z8K3M4N5P6Q7R8S9T0V1W2');"},{"lang":"php","label":"PHP","source":"use IntoSQL\\IntoSQL;\nuse IntoSQL\\Spec;\n\n$intosql = new IntoSQL(apiKey: getenv('INTOSQL_API_KEY'));\n\n$conversion = $intosql->conversions->cancel('01J9Z8K3M4N5P6Q7R8S9T0V1W2');"},{"lang":"python","label":"Python","source":"import os\nfrom intosql import IntoSQL, spec\n\nintosql = IntoSQL(os.environ[\"INTOSQL_API_KEY\"])\n\nconversion = intosql.conversions.cancel(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"},{"lang":"java","label":"Java","source":"IntoSQL intosql = new IntoSQL(System.getenv(\"INTOSQL_API_KEY\"));\n\nConversion conversion = intosql.conversions().cancel(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\");"},{"lang":"go","label":"Go","source":"client, err := intosql.NewClient(os.Getenv(\"INTOSQL_API_KEY\"))\nctx := context.Background()\n\nconversion, err := client.Conversions.Cancel(ctx, \"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"},{"lang":"csharp","label":"C#","source":"using IntoSQL;\n\nvar client = new IntoSQLClient(Environment.GetEnvironmentVariable(\"INTOSQL_API_KEY\")!);\n\nvar conversion = await client.Conversions.CancelAsync(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\");"},{"lang":"ruby","label":"Ruby","source":"require \"intosql\"\n\nintosql = IntoSQL::Client.new(api_key: ENV.fetch(\"INTOSQL_API_KEY\"))\n\nconversion = intosql.conversions.cancel(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\")"}]}},"/conversions/{id}/cases":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"createCase","summary":"Send us a conversion","description":"When a file didn't convert well, or at all, send it so we add support for it. With `share: file` the file goes too (a failed conversion keeps its upload until it expires); otherwise only the report and the spec. Cases are private, kept 90 days, and deleted after; the [privacy policy](/privacy) says how they are handled.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"consent":{"const":true,"description":"That the person agrees to send it, under the privacy policy."},"share":{"type":"string","enum":["file","report"],"default":"report"},"email":{"type":"string","format":"email","description":"Where to say when support lands."},"note":{"type":"string","maxLength":2000}},"required":["consent"]},"example":{"consent":true,"share":"file","note":"Exported from our ERP; the dates come out wrong."}}}},"responses":{"201":{"description":"The case.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Case"}},"required":["data"]}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"No conversion with that id on this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"409":{"description":"The conversion hasn't ended (`not_finished`), or its file is gone (`file_gone`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"`consent` is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"No API key, or not a valid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"402":{"description":"No Pro plan (`needs_pro`), or this month's conversions are used up (`over_quota`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The key can't use conversions, or the account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"405":{"description":"The path doesn't take this method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"More than 120 requests a minute with this key (`rate_limited`), or, when opening or starting a conversion, five already queued or running (`too_many_active`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}}},"x-codeSamples":[{"lang":"shell","label":"curl","source":"curl -X POST https://intosql.com/api/v1/conversions/01J9Z8K3M4N5P6Q7R8S9T0V1W2/cases \\\n  -H \"Authorization: Bearer $INTOSQL_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n      \"consent\": true,\n      \"share\": \"file\",\n      \"note\": \"Exported from our ERP; the dates come out wrong.\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { IntoSQL, spec } from '@intosql/sdk';\n\nconst intosql = new IntoSQL({ apiKey: process.env.INTOSQL_API_KEY! });\n\nconst sent = await intosql.conversions.createCase('01J9Z8K3M4N5P6Q7R8S9T0V1W2', {\n    consent: true,\n    share: 'file',\n    note: 'Exported from our ERP; the dates come out wrong.',\n});"},{"lang":"php","label":"PHP","source":"use IntoSQL\\IntoSQL;\nuse IntoSQL\\Spec;\n\n$intosql = new IntoSQL(apiKey: getenv('INTOSQL_API_KEY'));\n\n$sent = $intosql->conversions->createCase(\n    '01J9Z8K3M4N5P6Q7R8S9T0V1W2',\n    consent: true,\n    share: 'file',\n    note: 'Exported from our ERP; the dates come out wrong.',\n);"},{"lang":"python","label":"Python","source":"import os\nfrom intosql import IntoSQL, spec\n\nintosql = IntoSQL(os.environ[\"INTOSQL_API_KEY\"])\n\nsent = intosql.conversions.create_case(\n    \"01J9Z8K3M4N5P6Q7R8S9T0V1W2\",\n    consent=True,\n    share=\"file\",\n    note=\"Exported from our ERP; the dates come out wrong.\",\n)"},{"lang":"java","label":"Java","source":"IntoSQL intosql = new IntoSQL(System.getenv(\"INTOSQL_API_KEY\"));\n\nCase sent = intosql.conversions().createCase(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\", new CaseParams()\n    .consent(true)\n    .share(CaseShare.FILE)\n    .note(\"Exported from our ERP; the dates come out wrong.\"));"},{"lang":"go","label":"Go","source":"client, err := intosql.NewClient(os.Getenv(\"INTOSQL_API_KEY\"))\nctx := context.Background()\n\nsent, err := client.Conversions.CreateCase(ctx, \"01J9Z8K3M4N5P6Q7R8S9T0V1W2\", intosql.CaseParams{\n\tConsent: true,\n\tShare:   intosql.ShareFile,\n\tNote:    \"Exported from our ERP; the dates come out wrong.\",\n})"},{"lang":"csharp","label":"C#","source":"using IntoSQL;\n\nvar client = new IntoSQLClient(Environment.GetEnvironmentVariable(\"INTOSQL_API_KEY\")!);\n\nvar sent = await client.Conversions.CreateCaseAsync(\"01J9Z8K3M4N5P6Q7R8S9T0V1W2\", new CreateCaseOptions\n{\n    Consent = true,\n    Share = \"file\",\n    Note = \"Exported from our ERP; the dates come out wrong.\",\n});"},{"lang":"ruby","label":"Ruby","source":"require \"intosql\"\n\nintosql = IntoSQL::Client.new(api_key: ENV.fetch(\"INTOSQL_API_KEY\"))\n\nsent = intosql.conversions.create_case(\n  \"01J9Z8K3M4N5P6Q7R8S9T0V1W2\",\n  consent: true,\n  share: \"file\",\n  note: \"Exported from our ERP; the dates come out wrong.\"\n)"}]}},"/usage":{"get":{"operationId":"getUsage","summary":"This month's allowance","description":"Bytes included in the plan this month, used and left.","responses":{"200":{"description":"The allowance.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Usage"}},"required":["data"]}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"No API key, or not a valid one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"402":{"description":"No Pro plan (`needs_pro`), or this month's conversions are used up (`over_quota`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The key can't use conversions, or the account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"405":{"description":"The path doesn't take this method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"More than 120 requests a minute with this key (`rate_limited`), or, when opening or starting a conversion, five already queued or running (`too_many_active`). Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}}},"x-codeSamples":[{"lang":"shell","label":"curl","source":"curl -X GET https://intosql.com/api/v1/usage \\\n  -H \"Authorization: Bearer $INTOSQL_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { IntoSQL, spec } from '@intosql/sdk';\n\nconst intosql = new IntoSQL({ apiKey: process.env.INTOSQL_API_KEY! });\n\nconst usage = await intosql.usage();"},{"lang":"php","label":"PHP","source":"use IntoSQL\\IntoSQL;\nuse IntoSQL\\Spec;\n\n$intosql = new IntoSQL(apiKey: getenv('INTOSQL_API_KEY'));\n\n$usage = $intosql->usage();"},{"lang":"python","label":"Python","source":"import os\nfrom intosql import IntoSQL, spec\n\nintosql = IntoSQL(os.environ[\"INTOSQL_API_KEY\"])\n\nusage = intosql.usage()"},{"lang":"java","label":"Java","source":"IntoSQL intosql = new IntoSQL(System.getenv(\"INTOSQL_API_KEY\"));\n\nUsage usage = intosql.usage();"},{"lang":"go","label":"Go","source":"client, err := intosql.NewClient(os.Getenv(\"INTOSQL_API_KEY\"))\nctx := context.Background()\n\nusage, err := client.Usage(ctx)"},{"lang":"csharp","label":"C#","source":"using IntoSQL;\n\nvar client = new IntoSQLClient(Environment.GetEnvironmentVariable(\"INTOSQL_API_KEY\")!);\n\nvar usage = await client.GetUsageAsync();"},{"lang":"ruby","label":"Ruby","source":"require \"intosql\"\n\nintosql = IntoSQL::Client.new(api_key: ENV.fetch(\"INTOSQL_API_KEY\"))\n\nusage = intosql.usage"}]}}},"webhooks":{"conversionEvent":{"post":{"summary":"A conversion ended, or a test event","description":"Signed with `IntoSQL-Signature` (`t=<time>,v1=<HMAC-SHA256 of \"<time>.<body>\">`) and carrying `IntoSQL-Webhook-Id`. Answer with a 2xx; anything else is retried for about nine hours.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Delivered."}}}}},"components":{"headers":{"RequestId":{"description":"This answer's id; quote it when you ask for help.","schema":{"type":"string"}},"RetryAfter":{"description":"Seconds to wait before trying again.","schema":{"type":"integer"}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from Settings, API keys."}},"schemas":{"ColumnKind":{"description":"The kind of value a column holds, before it is mapped to a dialect's type.","oneOf":[{"type":"string","enum":["boolean","float","date","timestamp","json","geometry","uuid"]},{"description":"Fits in 4 bytes.","type":"string","const":"integer"},{"description":"Fits in 8 bytes.","type":"string","const":"bigint"},{"description":"Exact, with `precision` and `scale`.","type":"string","const":"decimal"},{"description":"A time of day without a date.","type":"string","const":"time"},{"description":"A timestamp with a UTC offset.","type":"string","const":"timestamptz"},{"description":"Text, `max_chars` long at most.","type":"string","const":"text"},{"description":"Bytes: `bytea`, `BLOB`, `VARBINARY`.","type":"string","const":"binary"},{"description":"A duration that may exceed a day.","type":"string","const":"interval"},{"description":"A fixed number of bits.","type":"string","const":"bits"},{"description":"A list of text values, such as a `MySQL` `SET`.","type":"string","const":"array"},{"description":"An IP address.","type":"string","const":"inet"}]},"ColumnNames":{"description":"How column names are written.","oneOf":[{"description":"ASCII `snake_case` every dialect reads without quotes: `Precio unitario` is\n`precio_unitario`.","type":"string","const":"snake_case"},{"description":"The header as it is, quoted where the dialect needs it: `\"Precio unitario\"`.","type":"string","const":"as_written"}]},"ColumnReport":{"description":"One column as it was read and as it was written.","type":"object","properties":{"source_name":{"description":"The name in the file.","type":"string"},"name":{"description":"The name in the SQL.","type":"string"},"sql_type":{"description":"The SQL type in the target dialect, e.g. `numeric(12,2)`.","type":"string"},"kind":{"$ref":"#/components/schemas/ColumnKind"},"precision":{"description":"Total digits, for decimals.","type":["integer","null"],"format":"uint32","minimum":0},"scale":{"description":"Digits after the point, for decimals.","type":["integer","null"],"format":"uint32","minimum":0},"max_chars":{"description":"The longest value in characters, for text.","type":["integer","null"],"format":"uint32","minimum":0},"nullable":{"type":"boolean"},"fixes":{"description":"Numbers of the fixes that touched this column.","type":"array","items":{"type":"integer","format":"uint32","minimum":0}},"excluded":{"description":"Left out of the output by the request.","type":"boolean","default":false},"as_text":{"description":"Kept as text by the request, whatever the values look like.","type":"boolean","default":false}},"required":["source_name","name","sql_type","kind","nullable","fixes"]},"ColumnSpec":{"description":"What to do with one column of the file, found by its position.","type":"object","properties":{"index":{"description":"0-based position of the column in the file.","type":"integer","format":"uint32","minimum":0},"name":{"description":"The name to write instead of the one derived from the header.","type":["string","null"],"default":null},"as_text":{"description":"Keep every value as written: the column becomes text.","type":"boolean","default":false},"exclude":{"description":"Leave the column out of the output.","type":"boolean","default":false}},"required":["index"]},"DateOrder":{"description":"How ambiguous dates such as 03/02/2024 are read.","oneOf":[{"type":"string","enum":["day_first","month_first","year_first"]},{"description":"Decided from the data: one unambiguous date settles the column.","type":"string","const":"auto"}]},"DetectedInput":{"description":"What was detected about the input.","type":"object","properties":{"format":{"$ref":"#/components/schemas/InputFormat"},"encoding":{"type":"string"},"delimiter":{"type":["string","null"]},"sheet":{"type":["string","null"]},"bytes":{"type":"integer","format":"uint64","minimum":0}},"required":["format","encoding","bytes"]},"Dialect":{"description":"The databases `IntoSQL` writes SQL for.","type":"string","enum":["postgresql","mysql","mariadb","sqlite","sql_server","oracle"]},"ErrorCode":{"description":"Problems: what stopped a conversion, left a row out or needs a look.","type":"string","enum":["unsupported_version","batch_rows_out_of_range","sample_rows_too_small","table_name_empty","table_name_too_long","column_name_empty","column_name_too_long","column_not_found","no_columns","unsupported_format","encrypted_file","corrupt_file","empty_file","sheet_not_found","invalid_date","invalid_number","invalid_time","invalid_boolean","value_too_long","ambiguous_reading","mixed_number_formats","other_table_skipped","invalid_json_row","ragged_row","dump_target_unsupported","dump_source_unsupported","dump_no_tables","dump_truncated","rows_unreadable","row_width_mismatch","statement_skipped","client_command_skipped","unsupported_charset","charset_guessed","dump_lost_four_byte_chars","timestamp_zone_assumed","case_insensitive_collation","no_schema","not_converted_objects","invalid_date_null","invalid_value_null","nul_removed","invalid_utf8_replaced","mojibake_suspected","expression_value","default_keyword_null","bad_geometry","enum_check_skipped","unknown_type","time_as_interval","myisam_group_autoincrement","generated_not_translated","default_not_translated","check_skipped","index_skipped","spatial_index_skipped","identity_without_counter","fulltext_not_created","spatial_index_not_created","sequence_not_converted","foreign_key_skipped","check_not_enforced"]},"Fix":{"description":"A correction the engine made, numbered like a proofreader's mark.","type":"object","properties":{"number":{"type":"integer","format":"uint32","minimum":0},"code":{"$ref":"#/components/schemas/FixCode"},"column":{"type":["string","null"]},"row":{"description":"1-based row in the file, when the fix is about one row.","type":["integer","null"],"format":"uint64","minimum":0},"args":{"description":"Arguments for the fix's message.","type":"object","additionalProperties":{"type":"string"}}},"required":["number","code","args"]},"FixCode":{"description":"Corrections the engine made, each with its evidence.","type":"string","enum":["leading_zeros_kept","dates_day_first","dates_month_first","decimal_comma_read","column_renamed","unnamed_column_named","duplicate_column_renamed","reserved_word_renamed","text_transcoded","boolean_words_read","null_markers_read","formatted_numbers_read","code_kept_as_text","read_by_locale","unclosed_quote_read","header_found","no_header_found","total_row_skipped","note_row_skipped","excel1904_dates","bool_kept_numeric","unsigned_widened","zerofill_dropped","float_scale_dropped","not_null_relaxed","zero_date_default","enum_invalid_value","json_not_jsonb","on_update_trigger","virtual_as_stored","invisible_column","prefix_unique","fulltext_as_gin","index_on_wide_values","identifier_renamed","name_shortened","geometry_as_wkb","geometry_inferred","decimal_as_text","geometry_as_blob","databases_merged","partitions_dropped","system_versioning_dropped","engine_dropped","replace_as_insert","default_keyword_filled"]},"InferenceSpec":{"description":"How column types are inferred.","type":"object","properties":{"sample_rows":{"description":"Rows read before the types are decided.","type":"integer","format":"uint32","minimum":0},"date_order":{"$ref":"#/components/schemas/DateOrder"},"keep_leading_zeros":{"description":"Values such as 00127 stay text so the zeros survive.","type":"boolean"},"locale":{"description":"A BCP 47 tag such as `es-MX`. Decides what the data can't: ambiguous dates and\ndecimal separators. Month-first and decimal point when absent.","type":["string","null"]}},"required":["sample_rows","date_order","keep_leading_zeros"]},"InputFormat":{"description":"What a file can be read as.","type":"string","enum":["xlsx","xls","xlsb","ods","csv","tsv","json","ndjson","sql_dump"]},"InputSpec":{"description":"How to read the input.","type":"object","properties":{"format":{"description":"Detected from the content when absent.","anyOf":[{"$ref":"#/components/schemas/InputFormat"},{"type":"null"}]},"encoding":{"description":"An encoding label such as `windows-1252`; detected when absent.","type":["string","null"]},"delimiter":{"description":"For delimited text; detected when absent.","type":["string","null"]},"sheet":{"description":"For spreadsheets; the first sheet when absent.","type":["string","null"]},"header_row":{"description":"1-based row holding the column names; detected when absent.","type":["integer","null"],"format":"uint32","minimum":0}}},"InspectReport":{"required":["version","input","sheets","columns","rows","fixes","problems","preview"],"properties":{"version":{"type":"integer","format":"uint32","minimum":0},"input":{"$ref":"#/components/schemas/DetectedInput"},"sheets":{"description":"The workbook's sheets; empty for text files.","type":"array","items":{"$ref":"#/components/schemas/SheetReport"}},"columns":{"type":"array","items":{"$ref":"#/components/schemas/ColumnReport"}},"rows":{"description":"Data rows, header and left-out rows aside.","type":"integer","format":"uint64","minimum":0},"fixes":{"type":"array","items":{"$ref":"#/components/schemas/Fix"}},"problems":{"type":"array","items":{"$ref":"#/components/schemas/Problem"}},"preview":{"type":"array","items":{"$ref":"#/components/schemas/PreviewRow"}},"source":{"description":"For a database dump: where it comes from.","anyOf":[{"$ref":"#/components/schemas/SourceReport"},{"type":"null"}],"default":null},"tables":{"description":"For a database dump: every table it holds, with its rows and how it would be written.","type":"array","items":{"$ref":"#/components/schemas/TableReport"},"default":[]},"not_converted":{"description":"For a database dump: the views, triggers, routines and events it would not carry.","type":"array","items":{"$ref":"#/components/schemas/NotConverted"},"default":[]}},"description":"What a file holds, before anything is converted: the same on every surface.","type":"object"},"JobReport":{"required":["version","input","dialect","table","columns","rows","fixes","problems","timings"],"properties":{"version":{"type":"integer","format":"uint32","minimum":0},"input":{"$ref":"#/components/schemas/DetectedInput"},"dialect":{"$ref":"#/components/schemas/Dialect"},"table":{"type":"string"},"columns":{"type":"array","items":{"$ref":"#/components/schemas/ColumnReport"}},"rows":{"$ref":"#/components/schemas/RowCounts"},"fixes":{"type":"array","items":{"$ref":"#/components/schemas/Fix"}},"problems":{"type":"array","items":{"$ref":"#/components/schemas/Problem"}},"timings":{"$ref":"#/components/schemas/Timings"},"source":{"description":"For a database dump: where it comes from.","anyOf":[{"$ref":"#/components/schemas/SourceReport"},{"type":"null"}],"default":null},"tables":{"description":"For a database dump: every table, with its own columns, fixes and problems. The fields\nabove then hold the totals and what concerns the whole dump.","type":"array","items":{"$ref":"#/components/schemas/TableReport"},"default":[]},"not_converted":{"description":"For a database dump: the views, triggers, routines and events it did not carry.","type":"array","items":{"$ref":"#/components/schemas/NotConverted"},"default":[]}},"description":"What a conversion did, the same on every surface.","type":"object"},"JobSpec":{"required":["version","input","output","inference"],"properties":{"version":{"type":"integer","format":"uint32","minimum":0},"input":{"$ref":"#/components/schemas/InputSpec"},"output":{"$ref":"#/components/schemas/OutputSpec"},"inference":{"$ref":"#/components/schemas/InferenceSpec"},"columns":{"description":"Changes to single columns; every other column is written as detected.","type":"array","items":{"$ref":"#/components/schemas/ColumnSpec"},"default":[]}},"description":"A conversion request, the same for the browser, the CLI, the API and MCP.","type":"object"},"NotConverted":{"description":"An object of a dump that the conversion did not carry: it is recreated by hand.","type":"object","properties":{"kind":{"$ref":"#/components/schemas/ObjectKind"},"name":{"description":"The name in the dump, with its database when the dump names more than one.","type":"string"}},"required":["kind","name"]},"ObjectKind":{"description":"What a database dump defines besides tables, which a conversion lists and does not carry.","type":"string","enum":["view","trigger","procedure","function","event"]},"OutputFormat":{"description":"What a conversion writes.","oneOf":[{"description":"A `.sql` script for the dialect.","type":"string","const":"sql"},{"description":"The cleaned table as CSV: UTF-8, a header row, values as the SQL stores them.","type":"string","const":"csv"},{"description":"The cleaned table as a JSON array of objects, typed.","type":"string","const":"json"}]},"OutputSpec":{"description":"What to write.","type":"object","properties":{"format":{"$ref":"#/components/schemas/OutputFormat"},"dialect":{"description":"Decides names and types, for every format.","$ref":"#/components/schemas/Dialect"},"table":{"description":"Derived from the file or sheet name when absent.","type":["string","null"]},"schema":{"type":["string","null"]},"create_table":{"type":"boolean"},"column_names":{"$ref":"#/components/schemas/ColumnNames"},"style":{"$ref":"#/components/schemas/OutputStyle"},"batch_rows":{"description":"Rows per statement or bulk batch.","type":"integer","format":"uint32","minimum":0}},"required":["format","dialect","create_table","column_names","style","batch_rows"]},"OutputStyle":{"description":"How rows are written.","oneOf":[{"description":"Multi-row `INSERT` statements, accepted everywhere.","type":"string","const":"inserts"},{"description":"The database's bulk path (`COPY`, `LOAD DATA`, `BULK INSERT`, SQL*Loader) where it has one.","type":"string","const":"bulk"}]},"PreviewRow":{"description":"One row of the preview, as text, with its number in the file.","type":"object","properties":{"number":{"type":"integer","format":"uint64","minimum":0},"values":{"description":"One value per column; empty cells are empty strings.","type":"array","items":{"type":"string"}}},"required":["number","values"]},"Problem":{"description":"Something that stopped the conversion, left a row out or needs a look.","type":"object","properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"severity":{"$ref":"#/components/schemas/Severity"},"column":{"type":["string","null"]},"row":{"type":["integer","null"],"format":"uint64","minimum":0},"args":{"description":"Arguments for the problem's message and hint.","type":"object","additionalProperties":{"type":"string"}}},"required":["code","severity","args"]},"RowCounts":{"description":"Row totals.","type":"object","properties":{"read":{"type":"integer","format":"uint64","minimum":0},"converted":{"type":"integer","format":"uint64","minimum":0},"rejected":{"type":"integer","format":"uint64","minimum":0}},"required":["read","converted","rejected"]},"Severity":{"description":"How serious a problem is.","oneOf":[{"description":"The conversion stopped.","type":"string","const":"error"},{"description":"A row was left out.","type":"string","const":"rejected"},{"description":"Converted, but worth a look.","type":"string","const":"warning"}]},"SheetReport":{"description":"A sheet of a workbook.","type":"object","properties":{"name":{"type":"string"},"hidden":{"type":"boolean"}},"required":["name","hidden"]},"SourceReport":{"description":"Where a database dump comes from.","type":"object","properties":{"dialect":{"description":"The database that wrote the dump, from its header and syntax.","$ref":"#/components/schemas/Dialect"},"version":{"description":"The server version the dump states, such as `8.0.40`.","type":["string","null"]},"producer":{"description":"The program that wrote it, such as `mysqldump` or `phpMyAdmin`.","type":["string","null"]},"charset":{"description":"The character set the dump declares, or the one read from its bytes.","type":["string","null"]},"databases":{"description":"The databases the dump holds, in order.","type":"array","items":{"type":"string"}}},"required":["dialect","databases"]},"TableReport":{"description":"One table of a database dump, as read and as written.","type":"object","properties":{"source_name":{"description":"The name in the dump.","type":"string"},"name":{"description":"The name in the SQL.","type":"string"},"schema":{"description":"The schema it goes in, when not the default one.","type":["string","null"]},"rows":{"description":"Rows in the dump; rows written when converted.","type":"integer","format":"uint64","minimum":0},"columns":{"type":"array","items":{"$ref":"#/components/schemas/ColumnReport"}},"fixes":{"description":"Fixes about this table and its columns, numbered across the whole report.","type":"array","items":{"$ref":"#/components/schemas/Fix"}},"problems":{"type":"array","items":{"$ref":"#/components/schemas/Problem"}}},"required":["source_name","name","rows","columns","fixes","problems"]},"Timings":{"description":"How long each stage took.","type":"object","properties":{"read_ms":{"type":"integer","format":"uint64","minimum":0},"convert_ms":{"type":"integer","format":"uint64","minimum":0},"total_ms":{"type":"integer","format":"uint64","minimum":0}},"required":["read_ms","convert_ms","total_ms"]},"Conversion":{"type":"object","properties":{"id":{"type":"string","description":"A ULID."},"status":{"type":"string","enum":["awaiting_upload","queued","running","done","failed","canceled"],"description":"Where the conversion is: waiting for its file, waiting for its turn, converting, or ended (done, failed or canceled)."},"name":{"type":"string","description":"The file's name, as sent or taken from its address."},"bytes":{"type":"integer","minimum":0,"description":"The file's size; 0 until a file sent by `url` arrives."},"spec":{"$ref":"#/components/schemas/JobSpec"},"report":{"anyOf":[{"$ref":"#/components/schemas/JobReport"},{"type":"null"}],"description":"The engine's report once the conversion is done: the table, its columns and types, rows converted and rejected, and every fix."},"error":{"anyOf":[{"$ref":"#/components/schemas/ConversionFailure"},{"type":"null"}],"description":"When `status` is `failed`: why, with a stable code."},"output":{"anyOf":[{"type":"object","properties":{"bytes":{"type":"integer"},"url":{"type":"string","format":"uri"}},"required":["bytes","url"]},{"type":"null"}],"description":"When `status` is `done`: the output's size in `bytes` and a `url` that downloads it for ten minutes."},"upload":{"anyOf":[{"type":"object","properties":{"method":{"const":"PUT"},"url":{"type":"string"},"headers":{"type":"object"}},"required":["method","url","headers"]},{"type":"null"}],"description":"In the answer that opens it, while `status` is `awaiting_upload`: where to `PUT` the file, with the `headers` to send, for an hour."},"created_at":{"type":["string","null"],"format":"date-time","description":"When the conversion was opened, in ISO 8601."},"started_at":{"type":["string","null"],"format":"date-time","description":"When the engine started on it."},"finished_at":{"type":["string","null"],"format":"date-time","description":"When it ended: done, failed or canceled."},"expires_at":{"type":"string","format":"date-time","description":"When its files are deleted."}},"required":["id","status","name","bytes","spec","report","error","output","upload","created_at","started_at","finished_at","expires_at"]},"ConversionFailure":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["not_uploaded","unreachable","download_stalled","too_big","over_quota","timed_out","account_suspended","internal_error"]},{"$ref":"#/components/schemas/ErrorCode"}],"description":"Stable. Ours for what happened on our side (a download, the time limit), the engine's for a file it refused."},"message":{"type":"string","description":"For people."},"problems":{"type":"array","items":{"$ref":"#/components/schemas/Problem"},"description":"What the engine found that stopped it, such as a spec value out of range."}},"required":["code","message","problems"]},"ConversionPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversion"}},"links":{"type":"object","properties":{"next":{"type":["string","null"],"format":"uri"},"prev":{"type":["string","null"],"format":"uri"}}},"meta":{"type":"object","properties":{"per_page":{"type":"integer"},"next_cursor":{"type":["string","null"],"description":"Pass as `cursor` for the next page; null on the last one."},"prev_cursor":{"type":["string","null"]}},"required":["per_page","next_cursor","prev_cursor"]}},"required":["data","links","meta"]},"Case":{"type":"object","properties":{"id":{"type":"string","description":"A ULID."},"conversion_id":{"type":["string","null"],"description":"The conversion it came from."},"share":{"type":"string","enum":["file","report"],"description":"What was sent: the file and its report, or the report only."},"status":{"type":"string","enum":["open","fixed","closed"],"description":"`fixed` once a release supports it."},"created_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":"string","format":"date-time","description":"When the case and its file are deleted."}},"required":["id","conversion_id","share","status","created_at","expires_at"]},"Usage":{"type":"object","properties":{"limit":{"type":"integer","description":"Bytes of files the plan converts on IntoSQL's servers each month."},"used":{"type":"integer","description":"Bytes converted so far this month."},"left":{"type":"integer","description":"Bytes left this month."},"period_start":{"type":"string","format":"date-time","description":"When this month's allowance started."}},"required":["limit","used","left","period_start"]},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","description":"The event's id, the same on every retry and in the `IntoSQL-Webhook-Id` header: drop one you have seen."},"type":{"type":"string","enum":["conversion.done","conversion.failed","conversion.canceled","ping"]},"created_at":{"type":"string","format":"date-time"},"data":{"anyOf":[{"$ref":"#/components/schemas/Conversion"},{"type":"object","properties":{"sent_at":{"type":"string","format":"date-time"}},"required":["sent_at"]}],"description":"The conversion as `GET /conversions/{id}` shows it; for `ping`, when it was sent."}},"required":["id","type","created_at","data"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthenticated","forbidden","suspended","needs_pro","over_quota","not_found","method_not_allowed","already_started","already_finished","not_uploaded","not_finished","file_gone","request_in_progress","too_big","invalid_request","invalid_spec","invalid_url","idempotency_mismatch","rate_limited","too_many_active","http_error","server_error"],"description":"Stable; new codes may be added within v1."},"message":{"type":"string","description":"For people."},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"With `invalid_request`: what is wrong with each field."},"request_id":{"type":"string","description":"The `X-Request-Id` of this answer. Quote it when you ask for help."}},"required":["code","message","request_id"]}},"required":["error"]}}}}