@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Session Manager API
@base https://apiexamples.vtexcommercestable.com.br
@version 1.0
@auth ApiKey vtex_session in cookie | ApiKey vtex_segment in cookie
@endpoints 4
@toc api(4)

@endpoint POST /api/sessions
@desc Create new session
@required {public: map{additionalProperties: map} # Public information.}
@returns(201) {sessionToken: str, segmentToken: str} # Created
@example_request {"public":{"variable1":{"value":"value1"},"variable2":{"value":"value2"}}}

@endpoint GET /api/sessions
@desc Get session
@required {items: str # Items are the keys of the values you wish to get. They follow the format `namespace1.key1,namespace2.key2`.  If you wish to recover the data sent on [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions), it should be `public.{key}`, replacing `{key}` with the name of the custom property you created. Following the example request presented in [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions), it would be `public.variable1,public.variable2`.  If you want to retrieve all keys from Session Manager, you can use the wildcard operator (`*`) as a value for this query parameter.}
@returns(200) {id: str, namespaces: map{account: map{id: map{value: str, keepAlive: bool}, accountName: map{value: str}}, store: map{channel: map{value: str}, countryCode: map{value: str}, cultureInfo: map{value: str}, currencyCode: map{value: str}, currencySymbol: map{value: str}, channelPrivacy: map{value: str}}, public: map, checkout: map{regionId: map{value: str}}}} # OK

@endpoint PATCH /api/sessions
@desc Edit session
@required {public: map{additionalProperties: map} # Public information.}
@returns(200) {sessionToken: str, segmentToken: str} # OK
@example_request {"public":{"variable2":{"value":"value2_patched"},"variable3":{"value":"value3"}}}

@endpoint GET /api/segments
@desc Get segment
@returns(200) {campaigns: str?, channel: str, priceTables: str?, regionId: str, utm_campaign: str?, utm_source: str?, utmi_campaign: str?, currencyCode: str, currencySymbol: str, countryCode: str, cultureInfo: str, channelPrivacy: str} # OK

@end
