import "./chunk-YPSWSI3M.js";

// src/docs/submission.json
var submission_default = "# Submission API\n\n- **Base URL:** `https://submission.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/submission](https://docs.epilot.io/api/submission)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<token>')\nconst { data } = await epilot.submission.createSubmission(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/submission'\n\nconst submissionClient = getClient()\nauthorize(submissionClient, () => '<token>')\nconst { data } = await submissionClient.createSubmission(...)\n```\n\n## Operations\n\n**Submissions**\n- [`createSubmission`](#createsubmission)\n- [`getNonce`](#getnonce)\n\n**Schemas**\n- [`SubmissionNonce`](#submissionnonce)\n- [`SubmissionPayload`](#submissionpayload)\n- [`SubmissionEntity`](#submissionentity)\n- [`OptIn`](#optin)\n- [`S3Reference`](#s3reference)\n\n### `createSubmission`\n\nCreates a submission from a public facing Journey\n\n`POST /v1/submission/submissions`\n\n```ts\nconst { data } = await client.createSubmission(\n  null,\n  {\n    organization_id: '123',\n    journey_submit_id: '123',\n    source_type: 'journey',\n    source_id: 'ce99875f-fba9-4fe2-a8f9-afaf52059051',\n    opt_ins: [\n      {\n        topic: 'EMAIL_MARKETING',\n        identifier: 'example@email.com',\n        meta: {}\n      }\n    ],\n    entities: [\n      {\n        _schema: 'submission',\n        description: 'Submission created via API',\n        contact_first_name: 'First',\n        contact_last_name: 'Last',\n        contact_email: 'example@submission.com',\n        request: 'I would like to know more about electric vehicles',\n        files: [\n          {\n            s3ref: {\n              bucket: 'epilot-user-content',\n              key: 'temp/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf'\n            },\n            filename: 'document.pdf'\n          }\n        ]\n      }\n    ],\n    _ivy_opportunity_ids: ['string']\n  },\n)\n```\n\n---\n\n### `getNonce`\n\nCheck if a nonce was already used (aka exists in storage)\n\n`GET /v1/submission/nonce/{nonce_id}`\n\n```ts\nconst { data } = await client.getNonce({\n  nonce_id: 'example',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n  \"nonce\": \"string\",\n  \"submission_id\": \"string\",\n  \"organization_id\": \"string\",\n  \"ttl\": 0,\n  \"exists\": true\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `SubmissionNonce`\n\n```ts\ntype SubmissionNonce = {\n  nonce: string\n  submission_id: string\n  organization_id: string\n  ttl?: number\n}\n```\n\n### `SubmissionPayload`\n\nHolds content and meta information\n\n```ts\ntype SubmissionPayload = {\n  organization_id?: string\n  journey_submit_id?: string\n  source_type: string\n  source_id: string\n  opt_ins?: Array<{\n    topic?: string\n    identifier?: string\n    meta?: Record<string, unknown>\n  }>\n  entities: Array<{\n    _schema: \"submission\"\n    description?: string\n    files?: Array<{\n      s3ref: { ... }\n      filename?: { ... }\n      _tags?: { ... }\n      relation_tags?: { ... }\n    }>\n  }>\n  _ivy_opportunity_ids?: string[]\n}\n```\n\n### `SubmissionEntity`\n\nThe submission entity to create\n\n```ts\ntype SubmissionEntity = {\n  _schema: \"submission\"\n  description?: string\n  files?: Array<{\n    s3ref: {\n      bucket: { ... }\n      key: { ... }\n    }\n    filename?: string\n    _tags?: string[]\n    relation_tags?: string[]\n  }>\n}\n```\n\n### `OptIn`\n\n```ts\ntype OptIn = {\n  topic?: string\n  identifier?: string\n  meta?: Record<string, unknown>\n}\n```\n\n### `S3Reference`\n\nS3 Reference from File API\n\n```ts\ntype S3Reference = {\n  bucket: string\n  key: string\n}\n```\n";
export {
  submission_default as default
};
