Create API Definition
POST {{baseUrl}}/api/apis
Create an API Definition. The id and api_id fields in the definition are auto-generated by Tyk and cannot be set by the user.
Request Body
{"api_definition"=>nil, "name"=>"Test", "auth"=>{"auth_header_name"=>"authorization"}, "definition"=>{"location"=>"header", "key"=>""}, "proxy"=>{"target_url"=>"http://httpbin.org/"}, "version_data"=>{"use_extended_paths"=>true, "not_versioned"=>true, "versions"=>{"Default"=>{"expires"=>"", "name"=>"Default", "extended_paths"=>{"ignored"=>[{"path"=>"/test-path/", "method_actions"=>{"GET"=>{"action"=>"no_action", "code"=>200, "data"=>""}}}, {"path"=>"/test-path/reply", "method_actions"=>{"GET"=>{"action"=>"reply", "code"=>200, "data"=>"{\"foo\":\"bar\"}", "headers"=>{"x-test"=>"test"}}}}]}, "use_extended_paths"=>true}}}, "use_oauth2"=>false, "oauth_meta"=>{"auth_login_redirect"=>"", "allowed_authorize_types"=>["token"]}, "notifications"=>{"shared_secret"=>"", "oauth_on_keychange_url"=>""}, "enable_ip_whitelisting"=>true, "allowed_ips"=>["127.0.0.1"], "use_keyless"=>false, "enable_signature_checking"=>false, "use_basic_auth"=>false, "active"=>true, "enable_batch_request_support"=>true, "hook_references"=>[{"event_name"=>"QuotaExceeded", "hook"=>{"id"=>"54be6c0beba6db07a6000002", "org_id"=>"54b53d3aeba6db5c35000002", "name"=>"Test Post", "method"=>"POST", "target_path"=>"http://httpbin.org/post", "template_path"=>"", "header_map"=>{"x-tyk-test"=>"123456"}, "event_timeout"=>0}, "event_timeout"=>60}]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"status":"ok","action":"created","key":"{...API JSON definition...}"}