{"openapi":"3.0.3","info":{"title":"InfluenceKit API","version":"v1","description":"REST API for InfluenceKit. Authenticate with an admin user's API key, sent either as an `X-API-KEY` header or an `api_key` query parameter."},"servers":[{"url":"https://api.influencekit.com"}],"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"paths":{"/v1/users/me":{"get":{"summary":"Return the authenticated user's information","responses":{"200":{"description":"The current user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Missing or invalid API key, or the key does not belong to an admin user"}}}},"/v1/campaigns":{"get":{"summary":"List campaigns, optionally filtered by name","parameters":[{"name":"campaign_name","in":"query","required":false,"schema":{"type":"string"},"description":"Exact campaign name to filter by"}],"responses":{"200":{"description":"Campaigns visible to the authenticated user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}}}}},"401":{"description":"Missing or invalid API key, or the key does not belong to an admin user"}}},"post":{"summary":"Create a campaign","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaign_name":{"type":"string","description":"Name for the new campaign"},"calendar_id":{"type":"integer","description":"Calendar to create the campaign on; defaults to the user's default calendar"}}}}}},"responses":{"201":{"description":"The created campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing or invalid API key, or the key does not belong to an admin user"}}}},"/v1/deliverables":{"post":{"summary":"Create a deliverable on a campaign, or update it if the URL already exists","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","campaign_id"],"properties":{"url":{"type":"string","description":"Public URL of the content"},"campaign_id":{"type":"integer","description":"Campaign the deliverable belongs to"},"statistics":{"type":"object","description":"Optional statistics payload to record for the deliverable"}}}}}},"responses":{"201":{"description":"The created or updated deliverable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deliverable"}}}},"401":{"description":"Missing or invalid API key, or the key does not belong to an admin user"}}}},"/v1/assignments":{"get":{"summary":"List assignments with partner creators, optionally filtered by creator email or assignment name","parameters":[{"name":"email","in":"query","required":false,"schema":{"type":"string"},"description":"Substring match on the creator's email"},{"name":"assignment_name","in":"query","required":false,"schema":{"type":"string"},"description":"Substring match on the assignment title"}],"responses":{"200":{"description":"Assignments for the authenticated brand","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Assignment"}}}}},"401":{"description":"Missing or invalid API key, or the key does not belong to an admin user"}}}},"/v1/assignments/{id}":{"patch":{"summary":"Update an assignment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"conversions":{"type":"number"},"attributed_revenue":{"type":"number"},"rate":{"type":"number"}}}}}},"responses":{"200":{"description":"The updated assignment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assignment"}}}},"401":{"description":"Missing or invalid API key, or the key does not belong to an admin user"},"404":{"description":"Assignment not found"}}}}},"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"ApiKeyQuery":{"type":"apiKey","in":"query","name":"api_key"}},"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer"},"email":{"type":"string"},"login":{"type":"string"},"tenant":{"type":"object"}}},"Campaign":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"report_url":{"type":"string","nullable":true},"user_name":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"ends_at":{"type":"string","format":"date-time","nullable":true}}},"Deliverable":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","nullable":true},"url":{"type":"string"},"statistics_values":{"type":"object","nullable":true},"stats_source":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"campaign":{"$ref":"#/components/schemas/Campaign"}}},"Assignment":{"type":"object","properties":{"id":{"type":"integer"},"influencer":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"rate":{"type":"number","nullable":true},"conversions":{"type":"number","nullable":true},"attributed_revenue":{"type":"number","nullable":true},"cpm":{"type":"number","nullable":true},"cpv":{"type":"number","nullable":true},"cpe":{"type":"number","nullable":true},"total_impressions":{"type":"integer","nullable":true},"total_views":{"type":"integer","nullable":true},"total_engagements":{"type":"integer","nullable":true},"deliverables_count":{"type":"integer","nullable":true},"deliverables_failing_count":{"type":"integer","nullable":true},"campaign":{"$ref":"#/components/schemas/Campaign","nullable":true}}}}}}