curl --request PATCH \
--url https://{tenant}/api/apis/streams/{apiId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"x-tyk-api-gateway": {
"info": {
"dbId": "<string>",
"expiration": "<string>",
"id": "<string>",
"name": "<string>",
"orgId": "<string>",
"state": {
"active": true,
"internal": true
},
"versioning": {
"default": "<string>",
"enabled": true,
"fallbackToDefault": true,
"key": "<string>",
"location": "<string>",
"name": "<string>",
"stripVersioningData": true,
"urlVersioningPattern": "<string>",
"versions": [
{
"id": "<string>",
"name": "<string>"
}
]
}
},
"middleware": {
"global": {
"cache": {
"cacheAllSafeRequests": true,
"cacheByHeaders": [
"<string>"
],
"cacheResponseCodes": [
123
],
"controlTTLHeaderName": "<string>",
"enableUpstreamCacheControl": true,
"enabled": true,
"timeout": 123
},
"contextVariables": {
"enabled": true
},
"cors": {
"allowCredentials": true,
"allowedHeaders": [
"<string>"
],
"allowedMethods": [
"<string>"
],
"allowedOrigins": [
"<string>"
],
"debug": true,
"enabled": true,
"exposedHeaders": [
"<string>"
],
"maxAge": 123,
"optionsPassthrough": true
},
"pluginConfig": {
"bundle": {
"enabled": true,
"path": "<string>"
},
"data": {
"enabled": true,
"value": {}
},
"driver": "<string>"
},
"postAuthenticationPlugin": {
"plugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
]
},
"postAuthenticationPlugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
],
"postPlugin": {
"plugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
]
},
"postPlugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
],
"prePlugin": {
"plugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
]
},
"prePlugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
],
"responsePlugin": {
"plugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
]
},
"responsePlugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
],
"trafficLogs": {
"enabled": true
},
"transformRequestHeaders": {
"add": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": true,
"remove": [
"<string>"
]
},
"transformResponseHeaders": {
"add": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": true,
"remove": [
"<string>"
]
}
},
"operations": {}
},
"server": {
"authentication": {
"baseIdentityProvider": "<string>",
"custom": {
"AuthSources": {
"cookie": {
"enabled": true,
"name": "<string>"
},
"header": {
"enabled": true,
"name": "<string>"
},
"query": {
"enabled": true,
"name": "<string>"
}
},
"config": {
"enabled": true,
"functionName": "<string>",
"idExtractor": {
"config": {
"formParamName": "<string>",
"headerName": "<string>",
"regexp": "<string>",
"regexpMatchIndex": 123,
"xPathExp": "<string>"
},
"enabled": true,
"source": "<string>",
"with": "<string>"
},
"path": "<string>",
"rawBodyOnly": true
},
"enabled": true
},
"enabled": true,
"hmac": {
"AuthSources": {
"cookie": {
"enabled": true,
"name": "<string>"
},
"header": {
"enabled": true,
"name": "<string>"
},
"query": {
"enabled": true,
"name": "<string>"
}
},
"allowedAlgorithms": [
"<string>"
],
"allowedClockSkew": 123,
"enabled": true
},
"oidc": {
"AuthSources": {
"cookie": {
"enabled": true,
"name": "<string>"
},
"header": {
"enabled": true,
"name": "<string>"
},
"query": {
"enabled": true,
"name": "<string>"
}
},
"enabled": true,
"providers": [
{
"clientToPolicyMapping": [
{
"clientId": "<string>",
"policyId": "<string>"
}
],
"issuer": "<string>"
}
],
"scopes": {
"claimName": "<string>",
"scopeToPolicyMapping": [
{
"policyId": "<string>",
"scope": "<string>"
}
]
},
"segregateByClientId": true
},
"securitySchemes": {},
"stripAuthorizationData": true
},
"clientCertificates": {
"allowlist": [
"<string>"
],
"enabled": true
},
"customDomain": {
"certificates": [
"<string>"
],
"enabled": true,
"name": "<string>"
},
"detailedActivityLogs": {
"enabled": true
},
"detailedTracing": {
"enabled": true
},
"eventHandlers": [
{
"enabled": true,
"id": "<string>",
"name": "<string>",
"trigger": "<string>",
"type": "<string>"
}
],
"gatewayTags": {
"enabled": true,
"tags": [
"<string>"
]
},
"listenPath": {
"strip": true,
"value": "<string>"
}
},
"upstream": {
"certificatePinning": {
"domainToPublicKeysMapping": [
{
"domain": "<string>",
"publicKeys": [
"<string>"
]
}
],
"enabled": true
},
"mutualTLS": {
"domainToCertificateMapping": [
{
"certificate": "<string>",
"domain": "<string>"
}
],
"enabled": true
},
"rateLimit": {
"enabled": true,
"per": "PT2H30M15S",
"rate": 123
},
"serviceDiscovery": {
"cache": {
"enabled": true,
"timeout": 123
},
"cacheTimeout": 123,
"dataPath": "<string>",
"enabled": true,
"endpointReturnsList": true,
"parentDataPath": "<string>",
"portDataPath": "<string>",
"queryEndpoint": "<string>",
"targetPath": "<string>",
"useNestedQuery": true,
"useTargetList": true
},
"test": {
"serviceDiscovery": {
"cache": {
"enabled": true,
"timeout": 123
},
"cacheTimeout": 123,
"dataPath": "<string>",
"enabled": true,
"endpointReturnsList": true,
"parentDataPath": "<string>",
"portDataPath": "<string>",
"queryEndpoint": "<string>",
"targetPath": "<string>",
"useNestedQuery": true,
"useTargetList": true
}
},
"url": "<string>"
}
},
"x-tyk-streaming": {
"streams": {}
}
}
'import requests
url = "https://{tenant}/api/apis/streams/{apiId}"
payload = {
"x-tyk-api-gateway": {
"info": {
"dbId": "<string>",
"expiration": "<string>",
"id": "<string>",
"name": "<string>",
"orgId": "<string>",
"state": {
"active": True,
"internal": True
},
"versioning": {
"default": "<string>",
"enabled": True,
"fallbackToDefault": True,
"key": "<string>",
"location": "<string>",
"name": "<string>",
"stripVersioningData": True,
"urlVersioningPattern": "<string>",
"versions": [
{
"id": "<string>",
"name": "<string>"
}
]
}
},
"middleware": {
"global": {
"cache": {
"cacheAllSafeRequests": True,
"cacheByHeaders": ["<string>"],
"cacheResponseCodes": [123],
"controlTTLHeaderName": "<string>",
"enableUpstreamCacheControl": True,
"enabled": True,
"timeout": 123
},
"contextVariables": { "enabled": True },
"cors": {
"allowCredentials": True,
"allowedHeaders": ["<string>"],
"allowedMethods": ["<string>"],
"allowedOrigins": ["<string>"],
"debug": True,
"enabled": True,
"exposedHeaders": ["<string>"],
"maxAge": 123,
"optionsPassthrough": True
},
"pluginConfig": {
"bundle": {
"enabled": True,
"path": "<string>"
},
"data": {
"enabled": True,
"value": {}
},
"driver": "<string>"
},
"postAuthenticationPlugin": { "plugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
] },
"postAuthenticationPlugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
],
"postPlugin": { "plugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
] },
"postPlugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
],
"prePlugin": { "plugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
] },
"prePlugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
],
"responsePlugin": { "plugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
] },
"responsePlugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
],
"trafficLogs": { "enabled": True },
"transformRequestHeaders": {
"add": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": True,
"remove": ["<string>"]
},
"transformResponseHeaders": {
"add": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": True,
"remove": ["<string>"]
}
},
"operations": {}
},
"server": {
"authentication": {
"baseIdentityProvider": "<string>",
"custom": {
"AuthSources": {
"cookie": {
"enabled": True,
"name": "<string>"
},
"header": {
"enabled": True,
"name": "<string>"
},
"query": {
"enabled": True,
"name": "<string>"
}
},
"config": {
"enabled": True,
"functionName": "<string>",
"idExtractor": {
"config": {
"formParamName": "<string>",
"headerName": "<string>",
"regexp": "<string>",
"regexpMatchIndex": 123,
"xPathExp": "<string>"
},
"enabled": True,
"source": "<string>",
"with": "<string>"
},
"path": "<string>",
"rawBodyOnly": True
},
"enabled": True
},
"enabled": True,
"hmac": {
"AuthSources": {
"cookie": {
"enabled": True,
"name": "<string>"
},
"header": {
"enabled": True,
"name": "<string>"
},
"query": {
"enabled": True,
"name": "<string>"
}
},
"allowedAlgorithms": ["<string>"],
"allowedClockSkew": 123,
"enabled": True
},
"oidc": {
"AuthSources": {
"cookie": {
"enabled": True,
"name": "<string>"
},
"header": {
"enabled": True,
"name": "<string>"
},
"query": {
"enabled": True,
"name": "<string>"
}
},
"enabled": True,
"providers": [
{
"clientToPolicyMapping": [
{
"clientId": "<string>",
"policyId": "<string>"
}
],
"issuer": "<string>"
}
],
"scopes": {
"claimName": "<string>",
"scopeToPolicyMapping": [
{
"policyId": "<string>",
"scope": "<string>"
}
]
},
"segregateByClientId": True
},
"securitySchemes": {},
"stripAuthorizationData": True
},
"clientCertificates": {
"allowlist": ["<string>"],
"enabled": True
},
"customDomain": {
"certificates": ["<string>"],
"enabled": True,
"name": "<string>"
},
"detailedActivityLogs": { "enabled": True },
"detailedTracing": { "enabled": True },
"eventHandlers": [
{
"enabled": True,
"id": "<string>",
"name": "<string>",
"trigger": "<string>",
"type": "<string>"
}
],
"gatewayTags": {
"enabled": True,
"tags": ["<string>"]
},
"listenPath": {
"strip": True,
"value": "<string>"
}
},
"upstream": {
"certificatePinning": {
"domainToPublicKeysMapping": [
{
"domain": "<string>",
"publicKeys": ["<string>"]
}
],
"enabled": True
},
"mutualTLS": {
"domainToCertificateMapping": [
{
"certificate": "<string>",
"domain": "<string>"
}
],
"enabled": True
},
"rateLimit": {
"enabled": True,
"per": "PT2H30M15S",
"rate": 123
},
"serviceDiscovery": {
"cache": {
"enabled": True,
"timeout": 123
},
"cacheTimeout": 123,
"dataPath": "<string>",
"enabled": True,
"endpointReturnsList": True,
"parentDataPath": "<string>",
"portDataPath": "<string>",
"queryEndpoint": "<string>",
"targetPath": "<string>",
"useNestedQuery": True,
"useTargetList": True
},
"test": { "serviceDiscovery": {
"cache": {
"enabled": True,
"timeout": 123
},
"cacheTimeout": 123,
"dataPath": "<string>",
"enabled": True,
"endpointReturnsList": True,
"parentDataPath": "<string>",
"portDataPath": "<string>",
"queryEndpoint": "<string>",
"targetPath": "<string>",
"useNestedQuery": True,
"useTargetList": True
} },
"url": "<string>"
}
},
"x-tyk-streaming": { "streams": {} }
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
'x-tyk-api-gateway': {
info: {
dbId: '<string>',
expiration: '<string>',
id: '<string>',
name: '<string>',
orgId: '<string>',
state: {active: true, internal: true},
versioning: {
default: '<string>',
enabled: true,
fallbackToDefault: true,
key: '<string>',
location: '<string>',
name: '<string>',
stripVersioningData: true,
urlVersioningPattern: '<string>',
versions: [{id: '<string>', name: '<string>'}]
}
},
middleware: {
global: {
cache: {
cacheAllSafeRequests: true,
cacheByHeaders: ['<string>'],
cacheResponseCodes: [123],
controlTTLHeaderName: '<string>',
enableUpstreamCacheControl: true,
enabled: true,
timeout: 123
},
contextVariables: {enabled: true},
cors: {
allowCredentials: true,
allowedHeaders: ['<string>'],
allowedMethods: ['<string>'],
allowedOrigins: ['<string>'],
debug: true,
enabled: true,
exposedHeaders: ['<string>'],
maxAge: 123,
optionsPassthrough: true
},
pluginConfig: {
bundle: {enabled: true, path: '<string>'},
data: {enabled: true, value: {}},
driver: '<string>'
},
postAuthenticationPlugin: {
plugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
]
},
postAuthenticationPlugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
],
postPlugin: {
plugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
]
},
postPlugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
],
prePlugin: {
plugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
]
},
prePlugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
],
responsePlugin: {
plugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
]
},
responsePlugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
],
trafficLogs: {enabled: true},
transformRequestHeaders: {
add: [{name: '<string>', value: '<string>'}],
enabled: true,
remove: ['<string>']
},
transformResponseHeaders: {
add: [{name: '<string>', value: '<string>'}],
enabled: true,
remove: ['<string>']
}
},
operations: {}
},
server: {
authentication: {
baseIdentityProvider: '<string>',
custom: {
AuthSources: {
cookie: {enabled: true, name: '<string>'},
header: {enabled: true, name: '<string>'},
query: {enabled: true, name: '<string>'}
},
config: {
enabled: true,
functionName: '<string>',
idExtractor: {
config: {
formParamName: '<string>',
headerName: '<string>',
regexp: '<string>',
regexpMatchIndex: 123,
xPathExp: '<string>'
},
enabled: true,
source: '<string>',
with: '<string>'
},
path: '<string>',
rawBodyOnly: true
},
enabled: true
},
enabled: true,
hmac: {
AuthSources: {
cookie: {enabled: true, name: '<string>'},
header: {enabled: true, name: '<string>'},
query: {enabled: true, name: '<string>'}
},
allowedAlgorithms: ['<string>'],
allowedClockSkew: 123,
enabled: true
},
oidc: {
AuthSources: {
cookie: {enabled: true, name: '<string>'},
header: {enabled: true, name: '<string>'},
query: {enabled: true, name: '<string>'}
},
enabled: true,
providers: [
{
clientToPolicyMapping: [{clientId: '<string>', policyId: '<string>'}],
issuer: '<string>'
}
],
scopes: {
claimName: '<string>',
scopeToPolicyMapping: [{policyId: '<string>', scope: '<string>'}]
},
segregateByClientId: true
},
securitySchemes: {},
stripAuthorizationData: true
},
clientCertificates: {allowlist: ['<string>'], enabled: true},
customDomain: {certificates: ['<string>'], enabled: true, name: '<string>'},
detailedActivityLogs: {enabled: true},
detailedTracing: {enabled: true},
eventHandlers: [
{
enabled: true,
id: '<string>',
name: '<string>',
trigger: '<string>',
type: '<string>'
}
],
gatewayTags: {enabled: true, tags: ['<string>']},
listenPath: {strip: true, value: '<string>'}
},
upstream: {
certificatePinning: {
domainToPublicKeysMapping: [{domain: '<string>', publicKeys: ['<string>']}],
enabled: true
},
mutualTLS: {
domainToCertificateMapping: [{certificate: '<string>', domain: '<string>'}],
enabled: true
},
rateLimit: {enabled: true, per: 'PT2H30M15S', rate: 123},
serviceDiscovery: {
cache: {enabled: true, timeout: 123},
cacheTimeout: 123,
dataPath: '<string>',
enabled: true,
endpointReturnsList: true,
parentDataPath: '<string>',
portDataPath: '<string>',
queryEndpoint: '<string>',
targetPath: '<string>',
useNestedQuery: true,
useTargetList: true
},
test: {
serviceDiscovery: {
cache: {enabled: true, timeout: 123},
cacheTimeout: 123,
dataPath: '<string>',
enabled: true,
endpointReturnsList: true,
parentDataPath: '<string>',
portDataPath: '<string>',
queryEndpoint: '<string>',
targetPath: '<string>',
useNestedQuery: true,
useTargetList: true
}
},
url: '<string>'
}
},
'x-tyk-streaming': {streams: {}}
})
};
fetch('https://{tenant}/api/apis/streams/{apiId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}/api/apis/streams/{apiId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'x-tyk-api-gateway' => [
'info' => [
'dbId' => '<string>',
'expiration' => '<string>',
'id' => '<string>',
'name' => '<string>',
'orgId' => '<string>',
'state' => [
'active' => true,
'internal' => true
],
'versioning' => [
'default' => '<string>',
'enabled' => true,
'fallbackToDefault' => true,
'key' => '<string>',
'location' => '<string>',
'name' => '<string>',
'stripVersioningData' => true,
'urlVersioningPattern' => '<string>',
'versions' => [
[
'id' => '<string>',
'name' => '<string>'
]
]
]
],
'middleware' => [
'global' => [
'cache' => [
'cacheAllSafeRequests' => true,
'cacheByHeaders' => [
'<string>'
],
'cacheResponseCodes' => [
123
],
'controlTTLHeaderName' => '<string>',
'enableUpstreamCacheControl' => true,
'enabled' => true,
'timeout' => 123
],
'contextVariables' => [
'enabled' => true
],
'cors' => [
'allowCredentials' => true,
'allowedHeaders' => [
'<string>'
],
'allowedMethods' => [
'<string>'
],
'allowedOrigins' => [
'<string>'
],
'debug' => true,
'enabled' => true,
'exposedHeaders' => [
'<string>'
],
'maxAge' => 123,
'optionsPassthrough' => true
],
'pluginConfig' => [
'bundle' => [
'enabled' => true,
'path' => '<string>'
],
'data' => [
'enabled' => true,
'value' => [
]
],
'driver' => '<string>'
],
'postAuthenticationPlugin' => [
'plugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
]
],
'postAuthenticationPlugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
],
'postPlugin' => [
'plugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
]
],
'postPlugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
],
'prePlugin' => [
'plugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
]
],
'prePlugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
],
'responsePlugin' => [
'plugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
]
],
'responsePlugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
],
'trafficLogs' => [
'enabled' => true
],
'transformRequestHeaders' => [
'add' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'enabled' => true,
'remove' => [
'<string>'
]
],
'transformResponseHeaders' => [
'add' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'enabled' => true,
'remove' => [
'<string>'
]
]
],
'operations' => [
]
],
'server' => [
'authentication' => [
'baseIdentityProvider' => '<string>',
'custom' => [
'AuthSources' => [
'cookie' => [
'enabled' => true,
'name' => '<string>'
],
'header' => [
'enabled' => true,
'name' => '<string>'
],
'query' => [
'enabled' => true,
'name' => '<string>'
]
],
'config' => [
'enabled' => true,
'functionName' => '<string>',
'idExtractor' => [
'config' => [
'formParamName' => '<string>',
'headerName' => '<string>',
'regexp' => '<string>',
'regexpMatchIndex' => 123,
'xPathExp' => '<string>'
],
'enabled' => true,
'source' => '<string>',
'with' => '<string>'
],
'path' => '<string>',
'rawBodyOnly' => true
],
'enabled' => true
],
'enabled' => true,
'hmac' => [
'AuthSources' => [
'cookie' => [
'enabled' => true,
'name' => '<string>'
],
'header' => [
'enabled' => true,
'name' => '<string>'
],
'query' => [
'enabled' => true,
'name' => '<string>'
]
],
'allowedAlgorithms' => [
'<string>'
],
'allowedClockSkew' => 123,
'enabled' => true
],
'oidc' => [
'AuthSources' => [
'cookie' => [
'enabled' => true,
'name' => '<string>'
],
'header' => [
'enabled' => true,
'name' => '<string>'
],
'query' => [
'enabled' => true,
'name' => '<string>'
]
],
'enabled' => true,
'providers' => [
[
'clientToPolicyMapping' => [
[
'clientId' => '<string>',
'policyId' => '<string>'
]
],
'issuer' => '<string>'
]
],
'scopes' => [
'claimName' => '<string>',
'scopeToPolicyMapping' => [
[
'policyId' => '<string>',
'scope' => '<string>'
]
]
],
'segregateByClientId' => true
],
'securitySchemes' => [
],
'stripAuthorizationData' => true
],
'clientCertificates' => [
'allowlist' => [
'<string>'
],
'enabled' => true
],
'customDomain' => [
'certificates' => [
'<string>'
],
'enabled' => true,
'name' => '<string>'
],
'detailedActivityLogs' => [
'enabled' => true
],
'detailedTracing' => [
'enabled' => true
],
'eventHandlers' => [
[
'enabled' => true,
'id' => '<string>',
'name' => '<string>',
'trigger' => '<string>',
'type' => '<string>'
]
],
'gatewayTags' => [
'enabled' => true,
'tags' => [
'<string>'
]
],
'listenPath' => [
'strip' => true,
'value' => '<string>'
]
],
'upstream' => [
'certificatePinning' => [
'domainToPublicKeysMapping' => [
[
'domain' => '<string>',
'publicKeys' => [
'<string>'
]
]
],
'enabled' => true
],
'mutualTLS' => [
'domainToCertificateMapping' => [
[
'certificate' => '<string>',
'domain' => '<string>'
]
],
'enabled' => true
],
'rateLimit' => [
'enabled' => true,
'per' => 'PT2H30M15S',
'rate' => 123
],
'serviceDiscovery' => [
'cache' => [
'enabled' => true,
'timeout' => 123
],
'cacheTimeout' => 123,
'dataPath' => '<string>',
'enabled' => true,
'endpointReturnsList' => true,
'parentDataPath' => '<string>',
'portDataPath' => '<string>',
'queryEndpoint' => '<string>',
'targetPath' => '<string>',
'useNestedQuery' => true,
'useTargetList' => true
],
'test' => [
'serviceDiscovery' => [
'cache' => [
'enabled' => true,
'timeout' => 123
],
'cacheTimeout' => 123,
'dataPath' => '<string>',
'enabled' => true,
'endpointReturnsList' => true,
'parentDataPath' => '<string>',
'portDataPath' => '<string>',
'queryEndpoint' => '<string>',
'targetPath' => '<string>',
'useNestedQuery' => true,
'useTargetList' => true
]
],
'url' => '<string>'
]
],
'x-tyk-streaming' => [
'streams' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/api/apis/streams/{apiId}"
payload := strings.NewReader("{\n \"x-tyk-api-gateway\": {\n \"info\": {\n \"dbId\": \"<string>\",\n \"expiration\": \"<string>\",\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"orgId\": \"<string>\",\n \"state\": {\n \"active\": true,\n \"internal\": true\n },\n \"versioning\": {\n \"default\": \"<string>\",\n \"enabled\": true,\n \"fallbackToDefault\": true,\n \"key\": \"<string>\",\n \"location\": \"<string>\",\n \"name\": \"<string>\",\n \"stripVersioningData\": true,\n \"urlVersioningPattern\": \"<string>\",\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n },\n \"middleware\": {\n \"global\": {\n \"cache\": {\n \"cacheAllSafeRequests\": true,\n \"cacheByHeaders\": [\n \"<string>\"\n ],\n \"cacheResponseCodes\": [\n 123\n ],\n \"controlTTLHeaderName\": \"<string>\",\n \"enableUpstreamCacheControl\": true,\n \"enabled\": true,\n \"timeout\": 123\n },\n \"contextVariables\": {\n \"enabled\": true\n },\n \"cors\": {\n \"allowCredentials\": true,\n \"allowedHeaders\": [\n \"<string>\"\n ],\n \"allowedMethods\": [\n \"<string>\"\n ],\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"debug\": true,\n \"enabled\": true,\n \"exposedHeaders\": [\n \"<string>\"\n ],\n \"maxAge\": 123,\n \"optionsPassthrough\": true\n },\n \"pluginConfig\": {\n \"bundle\": {\n \"enabled\": true,\n \"path\": \"<string>\"\n },\n \"data\": {\n \"enabled\": true,\n \"value\": {}\n },\n \"driver\": \"<string>\"\n },\n \"postAuthenticationPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postAuthenticationPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"postPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"prePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"prePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"responsePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"responsePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"trafficLogs\": {\n \"enabled\": true\n },\n \"transformRequestHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n },\n \"transformResponseHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n }\n },\n \"operations\": {}\n },\n \"server\": {\n \"authentication\": {\n \"baseIdentityProvider\": \"<string>\",\n \"custom\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"config\": {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"idExtractor\": {\n \"config\": {\n \"formParamName\": \"<string>\",\n \"headerName\": \"<string>\",\n \"regexp\": \"<string>\",\n \"regexpMatchIndex\": 123,\n \"xPathExp\": \"<string>\"\n },\n \"enabled\": true,\n \"source\": \"<string>\",\n \"with\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"rawBodyOnly\": true\n },\n \"enabled\": true\n },\n \"enabled\": true,\n \"hmac\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"allowedAlgorithms\": [\n \"<string>\"\n ],\n \"allowedClockSkew\": 123,\n \"enabled\": true\n },\n \"oidc\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"enabled\": true,\n \"providers\": [\n {\n \"clientToPolicyMapping\": [\n {\n \"clientId\": \"<string>\",\n \"policyId\": \"<string>\"\n }\n ],\n \"issuer\": \"<string>\"\n }\n ],\n \"scopes\": {\n \"claimName\": \"<string>\",\n \"scopeToPolicyMapping\": [\n {\n \"policyId\": \"<string>\",\n \"scope\": \"<string>\"\n }\n ]\n },\n \"segregateByClientId\": true\n },\n \"securitySchemes\": {},\n \"stripAuthorizationData\": true\n },\n \"clientCertificates\": {\n \"allowlist\": [\n \"<string>\"\n ],\n \"enabled\": true\n },\n \"customDomain\": {\n \"certificates\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"detailedActivityLogs\": {\n \"enabled\": true\n },\n \"detailedTracing\": {\n \"enabled\": true\n },\n \"eventHandlers\": [\n {\n \"enabled\": true,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"gatewayTags\": {\n \"enabled\": true,\n \"tags\": [\n \"<string>\"\n ]\n },\n \"listenPath\": {\n \"strip\": true,\n \"value\": \"<string>\"\n }\n },\n \"upstream\": {\n \"certificatePinning\": {\n \"domainToPublicKeysMapping\": [\n {\n \"domain\": \"<string>\",\n \"publicKeys\": [\n \"<string>\"\n ]\n }\n ],\n \"enabled\": true\n },\n \"mutualTLS\": {\n \"domainToCertificateMapping\": [\n {\n \"certificate\": \"<string>\",\n \"domain\": \"<string>\"\n }\n ],\n \"enabled\": true\n },\n \"rateLimit\": {\n \"enabled\": true,\n \"per\": \"PT2H30M15S\",\n \"rate\": 123\n },\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n },\n \"test\": {\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n }\n },\n \"url\": \"<string>\"\n }\n },\n \"x-tyk-streaming\": {\n \"streams\": {}\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{tenant}/api/apis/streams/{apiId}")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"x-tyk-api-gateway\": {\n \"info\": {\n \"dbId\": \"<string>\",\n \"expiration\": \"<string>\",\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"orgId\": \"<string>\",\n \"state\": {\n \"active\": true,\n \"internal\": true\n },\n \"versioning\": {\n \"default\": \"<string>\",\n \"enabled\": true,\n \"fallbackToDefault\": true,\n \"key\": \"<string>\",\n \"location\": \"<string>\",\n \"name\": \"<string>\",\n \"stripVersioningData\": true,\n \"urlVersioningPattern\": \"<string>\",\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n },\n \"middleware\": {\n \"global\": {\n \"cache\": {\n \"cacheAllSafeRequests\": true,\n \"cacheByHeaders\": [\n \"<string>\"\n ],\n \"cacheResponseCodes\": [\n 123\n ],\n \"controlTTLHeaderName\": \"<string>\",\n \"enableUpstreamCacheControl\": true,\n \"enabled\": true,\n \"timeout\": 123\n },\n \"contextVariables\": {\n \"enabled\": true\n },\n \"cors\": {\n \"allowCredentials\": true,\n \"allowedHeaders\": [\n \"<string>\"\n ],\n \"allowedMethods\": [\n \"<string>\"\n ],\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"debug\": true,\n \"enabled\": true,\n \"exposedHeaders\": [\n \"<string>\"\n ],\n \"maxAge\": 123,\n \"optionsPassthrough\": true\n },\n \"pluginConfig\": {\n \"bundle\": {\n \"enabled\": true,\n \"path\": \"<string>\"\n },\n \"data\": {\n \"enabled\": true,\n \"value\": {}\n },\n \"driver\": \"<string>\"\n },\n \"postAuthenticationPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postAuthenticationPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"postPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"prePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"prePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"responsePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"responsePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"trafficLogs\": {\n \"enabled\": true\n },\n \"transformRequestHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n },\n \"transformResponseHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n }\n },\n \"operations\": {}\n },\n \"server\": {\n \"authentication\": {\n \"baseIdentityProvider\": \"<string>\",\n \"custom\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"config\": {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"idExtractor\": {\n \"config\": {\n \"formParamName\": \"<string>\",\n \"headerName\": \"<string>\",\n \"regexp\": \"<string>\",\n \"regexpMatchIndex\": 123,\n \"xPathExp\": \"<string>\"\n },\n \"enabled\": true,\n \"source\": \"<string>\",\n \"with\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"rawBodyOnly\": true\n },\n \"enabled\": true\n },\n \"enabled\": true,\n \"hmac\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"allowedAlgorithms\": [\n \"<string>\"\n ],\n \"allowedClockSkew\": 123,\n \"enabled\": true\n },\n \"oidc\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"enabled\": true,\n \"providers\": [\n {\n \"clientToPolicyMapping\": [\n {\n \"clientId\": \"<string>\",\n \"policyId\": \"<string>\"\n }\n ],\n \"issuer\": \"<string>\"\n }\n ],\n \"scopes\": {\n \"claimName\": \"<string>\",\n \"scopeToPolicyMapping\": [\n {\n \"policyId\": \"<string>\",\n \"scope\": \"<string>\"\n }\n ]\n },\n \"segregateByClientId\": true\n },\n \"securitySchemes\": {},\n \"stripAuthorizationData\": true\n },\n \"clientCertificates\": {\n \"allowlist\": [\n \"<string>\"\n ],\n \"enabled\": true\n },\n \"customDomain\": {\n \"certificates\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"detailedActivityLogs\": {\n \"enabled\": true\n },\n \"detailedTracing\": {\n \"enabled\": true\n },\n \"eventHandlers\": [\n {\n \"enabled\": true,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"gatewayTags\": {\n \"enabled\": true,\n \"tags\": [\n \"<string>\"\n ]\n },\n \"listenPath\": {\n \"strip\": true,\n \"value\": \"<string>\"\n }\n },\n \"upstream\": {\n \"certificatePinning\": {\n \"domainToPublicKeysMapping\": [\n {\n \"domain\": \"<string>\",\n \"publicKeys\": [\n \"<string>\"\n ]\n }\n ],\n \"enabled\": true\n },\n \"mutualTLS\": {\n \"domainToCertificateMapping\": [\n {\n \"certificate\": \"<string>\",\n \"domain\": \"<string>\"\n }\n ],\n \"enabled\": true\n },\n \"rateLimit\": {\n \"enabled\": true,\n \"per\": \"PT2H30M15S\",\n \"rate\": 123\n },\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n },\n \"test\": {\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n }\n },\n \"url\": \"<string>\"\n }\n },\n \"x-tyk-streaming\": {\n \"streams\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/apis/streams/{apiId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"x-tyk-api-gateway\": {\n \"info\": {\n \"dbId\": \"<string>\",\n \"expiration\": \"<string>\",\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"orgId\": \"<string>\",\n \"state\": {\n \"active\": true,\n \"internal\": true\n },\n \"versioning\": {\n \"default\": \"<string>\",\n \"enabled\": true,\n \"fallbackToDefault\": true,\n \"key\": \"<string>\",\n \"location\": \"<string>\",\n \"name\": \"<string>\",\n \"stripVersioningData\": true,\n \"urlVersioningPattern\": \"<string>\",\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n },\n \"middleware\": {\n \"global\": {\n \"cache\": {\n \"cacheAllSafeRequests\": true,\n \"cacheByHeaders\": [\n \"<string>\"\n ],\n \"cacheResponseCodes\": [\n 123\n ],\n \"controlTTLHeaderName\": \"<string>\",\n \"enableUpstreamCacheControl\": true,\n \"enabled\": true,\n \"timeout\": 123\n },\n \"contextVariables\": {\n \"enabled\": true\n },\n \"cors\": {\n \"allowCredentials\": true,\n \"allowedHeaders\": [\n \"<string>\"\n ],\n \"allowedMethods\": [\n \"<string>\"\n ],\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"debug\": true,\n \"enabled\": true,\n \"exposedHeaders\": [\n \"<string>\"\n ],\n \"maxAge\": 123,\n \"optionsPassthrough\": true\n },\n \"pluginConfig\": {\n \"bundle\": {\n \"enabled\": true,\n \"path\": \"<string>\"\n },\n \"data\": {\n \"enabled\": true,\n \"value\": {}\n },\n \"driver\": \"<string>\"\n },\n \"postAuthenticationPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postAuthenticationPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"postPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"prePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"prePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"responsePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"responsePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"trafficLogs\": {\n \"enabled\": true\n },\n \"transformRequestHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n },\n \"transformResponseHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n }\n },\n \"operations\": {}\n },\n \"server\": {\n \"authentication\": {\n \"baseIdentityProvider\": \"<string>\",\n \"custom\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"config\": {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"idExtractor\": {\n \"config\": {\n \"formParamName\": \"<string>\",\n \"headerName\": \"<string>\",\n \"regexp\": \"<string>\",\n \"regexpMatchIndex\": 123,\n \"xPathExp\": \"<string>\"\n },\n \"enabled\": true,\n \"source\": \"<string>\",\n \"with\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"rawBodyOnly\": true\n },\n \"enabled\": true\n },\n \"enabled\": true,\n \"hmac\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"allowedAlgorithms\": [\n \"<string>\"\n ],\n \"allowedClockSkew\": 123,\n \"enabled\": true\n },\n \"oidc\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"enabled\": true,\n \"providers\": [\n {\n \"clientToPolicyMapping\": [\n {\n \"clientId\": \"<string>\",\n \"policyId\": \"<string>\"\n }\n ],\n \"issuer\": \"<string>\"\n }\n ],\n \"scopes\": {\n \"claimName\": \"<string>\",\n \"scopeToPolicyMapping\": [\n {\n \"policyId\": \"<string>\",\n \"scope\": \"<string>\"\n }\n ]\n },\n \"segregateByClientId\": true\n },\n \"securitySchemes\": {},\n \"stripAuthorizationData\": true\n },\n \"clientCertificates\": {\n \"allowlist\": [\n \"<string>\"\n ],\n \"enabled\": true\n },\n \"customDomain\": {\n \"certificates\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"detailedActivityLogs\": {\n \"enabled\": true\n },\n \"detailedTracing\": {\n \"enabled\": true\n },\n \"eventHandlers\": [\n {\n \"enabled\": true,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"gatewayTags\": {\n \"enabled\": true,\n \"tags\": [\n \"<string>\"\n ]\n },\n \"listenPath\": {\n \"strip\": true,\n \"value\": \"<string>\"\n }\n },\n \"upstream\": {\n \"certificatePinning\": {\n \"domainToPublicKeysMapping\": [\n {\n \"domain\": \"<string>\",\n \"publicKeys\": [\n \"<string>\"\n ]\n }\n ],\n \"enabled\": true\n },\n \"mutualTLS\": {\n \"domainToCertificateMapping\": [\n {\n \"certificate\": \"<string>\",\n \"domain\": \"<string>\"\n }\n ],\n \"enabled\": true\n },\n \"rateLimit\": {\n \"enabled\": true,\n \"per\": \"PT2H30M15S\",\n \"rate\": 123\n },\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n },\n \"test\": {\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n }\n },\n \"url\": \"<string>\"\n }\n },\n \"x-tyk-streaming\": {\n \"streams\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"Message": "API updated",
"Meta": null,
"Status": "OK"
}{
"Message": "Invalid `ID` value",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to update org object to DB.",
"Meta": null,
"Status": "Error"
}{
"Message": "API not found.",
"Meta": null,
"Status": "Error"
}Patch a single Streams API by ID.
Update a Tyk Streams API. You can use this endpoint to update the OAS part of your Tyk Streams API definition. This endpoint allows you to configure the Tyk OAS extension based on the query parameters provided (similar to import).
curl --request PATCH \
--url https://{tenant}/api/apis/streams/{apiId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"x-tyk-api-gateway": {
"info": {
"dbId": "<string>",
"expiration": "<string>",
"id": "<string>",
"name": "<string>",
"orgId": "<string>",
"state": {
"active": true,
"internal": true
},
"versioning": {
"default": "<string>",
"enabled": true,
"fallbackToDefault": true,
"key": "<string>",
"location": "<string>",
"name": "<string>",
"stripVersioningData": true,
"urlVersioningPattern": "<string>",
"versions": [
{
"id": "<string>",
"name": "<string>"
}
]
}
},
"middleware": {
"global": {
"cache": {
"cacheAllSafeRequests": true,
"cacheByHeaders": [
"<string>"
],
"cacheResponseCodes": [
123
],
"controlTTLHeaderName": "<string>",
"enableUpstreamCacheControl": true,
"enabled": true,
"timeout": 123
},
"contextVariables": {
"enabled": true
},
"cors": {
"allowCredentials": true,
"allowedHeaders": [
"<string>"
],
"allowedMethods": [
"<string>"
],
"allowedOrigins": [
"<string>"
],
"debug": true,
"enabled": true,
"exposedHeaders": [
"<string>"
],
"maxAge": 123,
"optionsPassthrough": true
},
"pluginConfig": {
"bundle": {
"enabled": true,
"path": "<string>"
},
"data": {
"enabled": true,
"value": {}
},
"driver": "<string>"
},
"postAuthenticationPlugin": {
"plugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
]
},
"postAuthenticationPlugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
],
"postPlugin": {
"plugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
]
},
"postPlugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
],
"prePlugin": {
"plugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
]
},
"prePlugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
],
"responsePlugin": {
"plugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
]
},
"responsePlugins": [
{
"enabled": true,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": true,
"requireSession": true
}
],
"trafficLogs": {
"enabled": true
},
"transformRequestHeaders": {
"add": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": true,
"remove": [
"<string>"
]
},
"transformResponseHeaders": {
"add": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": true,
"remove": [
"<string>"
]
}
},
"operations": {}
},
"server": {
"authentication": {
"baseIdentityProvider": "<string>",
"custom": {
"AuthSources": {
"cookie": {
"enabled": true,
"name": "<string>"
},
"header": {
"enabled": true,
"name": "<string>"
},
"query": {
"enabled": true,
"name": "<string>"
}
},
"config": {
"enabled": true,
"functionName": "<string>",
"idExtractor": {
"config": {
"formParamName": "<string>",
"headerName": "<string>",
"regexp": "<string>",
"regexpMatchIndex": 123,
"xPathExp": "<string>"
},
"enabled": true,
"source": "<string>",
"with": "<string>"
},
"path": "<string>",
"rawBodyOnly": true
},
"enabled": true
},
"enabled": true,
"hmac": {
"AuthSources": {
"cookie": {
"enabled": true,
"name": "<string>"
},
"header": {
"enabled": true,
"name": "<string>"
},
"query": {
"enabled": true,
"name": "<string>"
}
},
"allowedAlgorithms": [
"<string>"
],
"allowedClockSkew": 123,
"enabled": true
},
"oidc": {
"AuthSources": {
"cookie": {
"enabled": true,
"name": "<string>"
},
"header": {
"enabled": true,
"name": "<string>"
},
"query": {
"enabled": true,
"name": "<string>"
}
},
"enabled": true,
"providers": [
{
"clientToPolicyMapping": [
{
"clientId": "<string>",
"policyId": "<string>"
}
],
"issuer": "<string>"
}
],
"scopes": {
"claimName": "<string>",
"scopeToPolicyMapping": [
{
"policyId": "<string>",
"scope": "<string>"
}
]
},
"segregateByClientId": true
},
"securitySchemes": {},
"stripAuthorizationData": true
},
"clientCertificates": {
"allowlist": [
"<string>"
],
"enabled": true
},
"customDomain": {
"certificates": [
"<string>"
],
"enabled": true,
"name": "<string>"
},
"detailedActivityLogs": {
"enabled": true
},
"detailedTracing": {
"enabled": true
},
"eventHandlers": [
{
"enabled": true,
"id": "<string>",
"name": "<string>",
"trigger": "<string>",
"type": "<string>"
}
],
"gatewayTags": {
"enabled": true,
"tags": [
"<string>"
]
},
"listenPath": {
"strip": true,
"value": "<string>"
}
},
"upstream": {
"certificatePinning": {
"domainToPublicKeysMapping": [
{
"domain": "<string>",
"publicKeys": [
"<string>"
]
}
],
"enabled": true
},
"mutualTLS": {
"domainToCertificateMapping": [
{
"certificate": "<string>",
"domain": "<string>"
}
],
"enabled": true
},
"rateLimit": {
"enabled": true,
"per": "PT2H30M15S",
"rate": 123
},
"serviceDiscovery": {
"cache": {
"enabled": true,
"timeout": 123
},
"cacheTimeout": 123,
"dataPath": "<string>",
"enabled": true,
"endpointReturnsList": true,
"parentDataPath": "<string>",
"portDataPath": "<string>",
"queryEndpoint": "<string>",
"targetPath": "<string>",
"useNestedQuery": true,
"useTargetList": true
},
"test": {
"serviceDiscovery": {
"cache": {
"enabled": true,
"timeout": 123
},
"cacheTimeout": 123,
"dataPath": "<string>",
"enabled": true,
"endpointReturnsList": true,
"parentDataPath": "<string>",
"portDataPath": "<string>",
"queryEndpoint": "<string>",
"targetPath": "<string>",
"useNestedQuery": true,
"useTargetList": true
}
},
"url": "<string>"
}
},
"x-tyk-streaming": {
"streams": {}
}
}
'import requests
url = "https://{tenant}/api/apis/streams/{apiId}"
payload = {
"x-tyk-api-gateway": {
"info": {
"dbId": "<string>",
"expiration": "<string>",
"id": "<string>",
"name": "<string>",
"orgId": "<string>",
"state": {
"active": True,
"internal": True
},
"versioning": {
"default": "<string>",
"enabled": True,
"fallbackToDefault": True,
"key": "<string>",
"location": "<string>",
"name": "<string>",
"stripVersioningData": True,
"urlVersioningPattern": "<string>",
"versions": [
{
"id": "<string>",
"name": "<string>"
}
]
}
},
"middleware": {
"global": {
"cache": {
"cacheAllSafeRequests": True,
"cacheByHeaders": ["<string>"],
"cacheResponseCodes": [123],
"controlTTLHeaderName": "<string>",
"enableUpstreamCacheControl": True,
"enabled": True,
"timeout": 123
},
"contextVariables": { "enabled": True },
"cors": {
"allowCredentials": True,
"allowedHeaders": ["<string>"],
"allowedMethods": ["<string>"],
"allowedOrigins": ["<string>"],
"debug": True,
"enabled": True,
"exposedHeaders": ["<string>"],
"maxAge": 123,
"optionsPassthrough": True
},
"pluginConfig": {
"bundle": {
"enabled": True,
"path": "<string>"
},
"data": {
"enabled": True,
"value": {}
},
"driver": "<string>"
},
"postAuthenticationPlugin": { "plugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
] },
"postAuthenticationPlugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
],
"postPlugin": { "plugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
] },
"postPlugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
],
"prePlugin": { "plugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
] },
"prePlugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
],
"responsePlugin": { "plugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
] },
"responsePlugins": [
{
"enabled": True,
"functionName": "<string>",
"path": "<string>",
"rawBodyOnly": True,
"requireSession": True
}
],
"trafficLogs": { "enabled": True },
"transformRequestHeaders": {
"add": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": True,
"remove": ["<string>"]
},
"transformResponseHeaders": {
"add": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": True,
"remove": ["<string>"]
}
},
"operations": {}
},
"server": {
"authentication": {
"baseIdentityProvider": "<string>",
"custom": {
"AuthSources": {
"cookie": {
"enabled": True,
"name": "<string>"
},
"header": {
"enabled": True,
"name": "<string>"
},
"query": {
"enabled": True,
"name": "<string>"
}
},
"config": {
"enabled": True,
"functionName": "<string>",
"idExtractor": {
"config": {
"formParamName": "<string>",
"headerName": "<string>",
"regexp": "<string>",
"regexpMatchIndex": 123,
"xPathExp": "<string>"
},
"enabled": True,
"source": "<string>",
"with": "<string>"
},
"path": "<string>",
"rawBodyOnly": True
},
"enabled": True
},
"enabled": True,
"hmac": {
"AuthSources": {
"cookie": {
"enabled": True,
"name": "<string>"
},
"header": {
"enabled": True,
"name": "<string>"
},
"query": {
"enabled": True,
"name": "<string>"
}
},
"allowedAlgorithms": ["<string>"],
"allowedClockSkew": 123,
"enabled": True
},
"oidc": {
"AuthSources": {
"cookie": {
"enabled": True,
"name": "<string>"
},
"header": {
"enabled": True,
"name": "<string>"
},
"query": {
"enabled": True,
"name": "<string>"
}
},
"enabled": True,
"providers": [
{
"clientToPolicyMapping": [
{
"clientId": "<string>",
"policyId": "<string>"
}
],
"issuer": "<string>"
}
],
"scopes": {
"claimName": "<string>",
"scopeToPolicyMapping": [
{
"policyId": "<string>",
"scope": "<string>"
}
]
},
"segregateByClientId": True
},
"securitySchemes": {},
"stripAuthorizationData": True
},
"clientCertificates": {
"allowlist": ["<string>"],
"enabled": True
},
"customDomain": {
"certificates": ["<string>"],
"enabled": True,
"name": "<string>"
},
"detailedActivityLogs": { "enabled": True },
"detailedTracing": { "enabled": True },
"eventHandlers": [
{
"enabled": True,
"id": "<string>",
"name": "<string>",
"trigger": "<string>",
"type": "<string>"
}
],
"gatewayTags": {
"enabled": True,
"tags": ["<string>"]
},
"listenPath": {
"strip": True,
"value": "<string>"
}
},
"upstream": {
"certificatePinning": {
"domainToPublicKeysMapping": [
{
"domain": "<string>",
"publicKeys": ["<string>"]
}
],
"enabled": True
},
"mutualTLS": {
"domainToCertificateMapping": [
{
"certificate": "<string>",
"domain": "<string>"
}
],
"enabled": True
},
"rateLimit": {
"enabled": True,
"per": "PT2H30M15S",
"rate": 123
},
"serviceDiscovery": {
"cache": {
"enabled": True,
"timeout": 123
},
"cacheTimeout": 123,
"dataPath": "<string>",
"enabled": True,
"endpointReturnsList": True,
"parentDataPath": "<string>",
"portDataPath": "<string>",
"queryEndpoint": "<string>",
"targetPath": "<string>",
"useNestedQuery": True,
"useTargetList": True
},
"test": { "serviceDiscovery": {
"cache": {
"enabled": True,
"timeout": 123
},
"cacheTimeout": 123,
"dataPath": "<string>",
"enabled": True,
"endpointReturnsList": True,
"parentDataPath": "<string>",
"portDataPath": "<string>",
"queryEndpoint": "<string>",
"targetPath": "<string>",
"useNestedQuery": True,
"useTargetList": True
} },
"url": "<string>"
}
},
"x-tyk-streaming": { "streams": {} }
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
'x-tyk-api-gateway': {
info: {
dbId: '<string>',
expiration: '<string>',
id: '<string>',
name: '<string>',
orgId: '<string>',
state: {active: true, internal: true},
versioning: {
default: '<string>',
enabled: true,
fallbackToDefault: true,
key: '<string>',
location: '<string>',
name: '<string>',
stripVersioningData: true,
urlVersioningPattern: '<string>',
versions: [{id: '<string>', name: '<string>'}]
}
},
middleware: {
global: {
cache: {
cacheAllSafeRequests: true,
cacheByHeaders: ['<string>'],
cacheResponseCodes: [123],
controlTTLHeaderName: '<string>',
enableUpstreamCacheControl: true,
enabled: true,
timeout: 123
},
contextVariables: {enabled: true},
cors: {
allowCredentials: true,
allowedHeaders: ['<string>'],
allowedMethods: ['<string>'],
allowedOrigins: ['<string>'],
debug: true,
enabled: true,
exposedHeaders: ['<string>'],
maxAge: 123,
optionsPassthrough: true
},
pluginConfig: {
bundle: {enabled: true, path: '<string>'},
data: {enabled: true, value: {}},
driver: '<string>'
},
postAuthenticationPlugin: {
plugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
]
},
postAuthenticationPlugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
],
postPlugin: {
plugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
]
},
postPlugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
],
prePlugin: {
plugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
]
},
prePlugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
],
responsePlugin: {
plugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
]
},
responsePlugins: [
{
enabled: true,
functionName: '<string>',
path: '<string>',
rawBodyOnly: true,
requireSession: true
}
],
trafficLogs: {enabled: true},
transformRequestHeaders: {
add: [{name: '<string>', value: '<string>'}],
enabled: true,
remove: ['<string>']
},
transformResponseHeaders: {
add: [{name: '<string>', value: '<string>'}],
enabled: true,
remove: ['<string>']
}
},
operations: {}
},
server: {
authentication: {
baseIdentityProvider: '<string>',
custom: {
AuthSources: {
cookie: {enabled: true, name: '<string>'},
header: {enabled: true, name: '<string>'},
query: {enabled: true, name: '<string>'}
},
config: {
enabled: true,
functionName: '<string>',
idExtractor: {
config: {
formParamName: '<string>',
headerName: '<string>',
regexp: '<string>',
regexpMatchIndex: 123,
xPathExp: '<string>'
},
enabled: true,
source: '<string>',
with: '<string>'
},
path: '<string>',
rawBodyOnly: true
},
enabled: true
},
enabled: true,
hmac: {
AuthSources: {
cookie: {enabled: true, name: '<string>'},
header: {enabled: true, name: '<string>'},
query: {enabled: true, name: '<string>'}
},
allowedAlgorithms: ['<string>'],
allowedClockSkew: 123,
enabled: true
},
oidc: {
AuthSources: {
cookie: {enabled: true, name: '<string>'},
header: {enabled: true, name: '<string>'},
query: {enabled: true, name: '<string>'}
},
enabled: true,
providers: [
{
clientToPolicyMapping: [{clientId: '<string>', policyId: '<string>'}],
issuer: '<string>'
}
],
scopes: {
claimName: '<string>',
scopeToPolicyMapping: [{policyId: '<string>', scope: '<string>'}]
},
segregateByClientId: true
},
securitySchemes: {},
stripAuthorizationData: true
},
clientCertificates: {allowlist: ['<string>'], enabled: true},
customDomain: {certificates: ['<string>'], enabled: true, name: '<string>'},
detailedActivityLogs: {enabled: true},
detailedTracing: {enabled: true},
eventHandlers: [
{
enabled: true,
id: '<string>',
name: '<string>',
trigger: '<string>',
type: '<string>'
}
],
gatewayTags: {enabled: true, tags: ['<string>']},
listenPath: {strip: true, value: '<string>'}
},
upstream: {
certificatePinning: {
domainToPublicKeysMapping: [{domain: '<string>', publicKeys: ['<string>']}],
enabled: true
},
mutualTLS: {
domainToCertificateMapping: [{certificate: '<string>', domain: '<string>'}],
enabled: true
},
rateLimit: {enabled: true, per: 'PT2H30M15S', rate: 123},
serviceDiscovery: {
cache: {enabled: true, timeout: 123},
cacheTimeout: 123,
dataPath: '<string>',
enabled: true,
endpointReturnsList: true,
parentDataPath: '<string>',
portDataPath: '<string>',
queryEndpoint: '<string>',
targetPath: '<string>',
useNestedQuery: true,
useTargetList: true
},
test: {
serviceDiscovery: {
cache: {enabled: true, timeout: 123},
cacheTimeout: 123,
dataPath: '<string>',
enabled: true,
endpointReturnsList: true,
parentDataPath: '<string>',
portDataPath: '<string>',
queryEndpoint: '<string>',
targetPath: '<string>',
useNestedQuery: true,
useTargetList: true
}
},
url: '<string>'
}
},
'x-tyk-streaming': {streams: {}}
})
};
fetch('https://{tenant}/api/apis/streams/{apiId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}/api/apis/streams/{apiId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'x-tyk-api-gateway' => [
'info' => [
'dbId' => '<string>',
'expiration' => '<string>',
'id' => '<string>',
'name' => '<string>',
'orgId' => '<string>',
'state' => [
'active' => true,
'internal' => true
],
'versioning' => [
'default' => '<string>',
'enabled' => true,
'fallbackToDefault' => true,
'key' => '<string>',
'location' => '<string>',
'name' => '<string>',
'stripVersioningData' => true,
'urlVersioningPattern' => '<string>',
'versions' => [
[
'id' => '<string>',
'name' => '<string>'
]
]
]
],
'middleware' => [
'global' => [
'cache' => [
'cacheAllSafeRequests' => true,
'cacheByHeaders' => [
'<string>'
],
'cacheResponseCodes' => [
123
],
'controlTTLHeaderName' => '<string>',
'enableUpstreamCacheControl' => true,
'enabled' => true,
'timeout' => 123
],
'contextVariables' => [
'enabled' => true
],
'cors' => [
'allowCredentials' => true,
'allowedHeaders' => [
'<string>'
],
'allowedMethods' => [
'<string>'
],
'allowedOrigins' => [
'<string>'
],
'debug' => true,
'enabled' => true,
'exposedHeaders' => [
'<string>'
],
'maxAge' => 123,
'optionsPassthrough' => true
],
'pluginConfig' => [
'bundle' => [
'enabled' => true,
'path' => '<string>'
],
'data' => [
'enabled' => true,
'value' => [
]
],
'driver' => '<string>'
],
'postAuthenticationPlugin' => [
'plugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
]
],
'postAuthenticationPlugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
],
'postPlugin' => [
'plugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
]
],
'postPlugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
],
'prePlugin' => [
'plugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
]
],
'prePlugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
],
'responsePlugin' => [
'plugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
]
],
'responsePlugins' => [
[
'enabled' => true,
'functionName' => '<string>',
'path' => '<string>',
'rawBodyOnly' => true,
'requireSession' => true
]
],
'trafficLogs' => [
'enabled' => true
],
'transformRequestHeaders' => [
'add' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'enabled' => true,
'remove' => [
'<string>'
]
],
'transformResponseHeaders' => [
'add' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'enabled' => true,
'remove' => [
'<string>'
]
]
],
'operations' => [
]
],
'server' => [
'authentication' => [
'baseIdentityProvider' => '<string>',
'custom' => [
'AuthSources' => [
'cookie' => [
'enabled' => true,
'name' => '<string>'
],
'header' => [
'enabled' => true,
'name' => '<string>'
],
'query' => [
'enabled' => true,
'name' => '<string>'
]
],
'config' => [
'enabled' => true,
'functionName' => '<string>',
'idExtractor' => [
'config' => [
'formParamName' => '<string>',
'headerName' => '<string>',
'regexp' => '<string>',
'regexpMatchIndex' => 123,
'xPathExp' => '<string>'
],
'enabled' => true,
'source' => '<string>',
'with' => '<string>'
],
'path' => '<string>',
'rawBodyOnly' => true
],
'enabled' => true
],
'enabled' => true,
'hmac' => [
'AuthSources' => [
'cookie' => [
'enabled' => true,
'name' => '<string>'
],
'header' => [
'enabled' => true,
'name' => '<string>'
],
'query' => [
'enabled' => true,
'name' => '<string>'
]
],
'allowedAlgorithms' => [
'<string>'
],
'allowedClockSkew' => 123,
'enabled' => true
],
'oidc' => [
'AuthSources' => [
'cookie' => [
'enabled' => true,
'name' => '<string>'
],
'header' => [
'enabled' => true,
'name' => '<string>'
],
'query' => [
'enabled' => true,
'name' => '<string>'
]
],
'enabled' => true,
'providers' => [
[
'clientToPolicyMapping' => [
[
'clientId' => '<string>',
'policyId' => '<string>'
]
],
'issuer' => '<string>'
]
],
'scopes' => [
'claimName' => '<string>',
'scopeToPolicyMapping' => [
[
'policyId' => '<string>',
'scope' => '<string>'
]
]
],
'segregateByClientId' => true
],
'securitySchemes' => [
],
'stripAuthorizationData' => true
],
'clientCertificates' => [
'allowlist' => [
'<string>'
],
'enabled' => true
],
'customDomain' => [
'certificates' => [
'<string>'
],
'enabled' => true,
'name' => '<string>'
],
'detailedActivityLogs' => [
'enabled' => true
],
'detailedTracing' => [
'enabled' => true
],
'eventHandlers' => [
[
'enabled' => true,
'id' => '<string>',
'name' => '<string>',
'trigger' => '<string>',
'type' => '<string>'
]
],
'gatewayTags' => [
'enabled' => true,
'tags' => [
'<string>'
]
],
'listenPath' => [
'strip' => true,
'value' => '<string>'
]
],
'upstream' => [
'certificatePinning' => [
'domainToPublicKeysMapping' => [
[
'domain' => '<string>',
'publicKeys' => [
'<string>'
]
]
],
'enabled' => true
],
'mutualTLS' => [
'domainToCertificateMapping' => [
[
'certificate' => '<string>',
'domain' => '<string>'
]
],
'enabled' => true
],
'rateLimit' => [
'enabled' => true,
'per' => 'PT2H30M15S',
'rate' => 123
],
'serviceDiscovery' => [
'cache' => [
'enabled' => true,
'timeout' => 123
],
'cacheTimeout' => 123,
'dataPath' => '<string>',
'enabled' => true,
'endpointReturnsList' => true,
'parentDataPath' => '<string>',
'portDataPath' => '<string>',
'queryEndpoint' => '<string>',
'targetPath' => '<string>',
'useNestedQuery' => true,
'useTargetList' => true
],
'test' => [
'serviceDiscovery' => [
'cache' => [
'enabled' => true,
'timeout' => 123
],
'cacheTimeout' => 123,
'dataPath' => '<string>',
'enabled' => true,
'endpointReturnsList' => true,
'parentDataPath' => '<string>',
'portDataPath' => '<string>',
'queryEndpoint' => '<string>',
'targetPath' => '<string>',
'useNestedQuery' => true,
'useTargetList' => true
]
],
'url' => '<string>'
]
],
'x-tyk-streaming' => [
'streams' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/api/apis/streams/{apiId}"
payload := strings.NewReader("{\n \"x-tyk-api-gateway\": {\n \"info\": {\n \"dbId\": \"<string>\",\n \"expiration\": \"<string>\",\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"orgId\": \"<string>\",\n \"state\": {\n \"active\": true,\n \"internal\": true\n },\n \"versioning\": {\n \"default\": \"<string>\",\n \"enabled\": true,\n \"fallbackToDefault\": true,\n \"key\": \"<string>\",\n \"location\": \"<string>\",\n \"name\": \"<string>\",\n \"stripVersioningData\": true,\n \"urlVersioningPattern\": \"<string>\",\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n },\n \"middleware\": {\n \"global\": {\n \"cache\": {\n \"cacheAllSafeRequests\": true,\n \"cacheByHeaders\": [\n \"<string>\"\n ],\n \"cacheResponseCodes\": [\n 123\n ],\n \"controlTTLHeaderName\": \"<string>\",\n \"enableUpstreamCacheControl\": true,\n \"enabled\": true,\n \"timeout\": 123\n },\n \"contextVariables\": {\n \"enabled\": true\n },\n \"cors\": {\n \"allowCredentials\": true,\n \"allowedHeaders\": [\n \"<string>\"\n ],\n \"allowedMethods\": [\n \"<string>\"\n ],\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"debug\": true,\n \"enabled\": true,\n \"exposedHeaders\": [\n \"<string>\"\n ],\n \"maxAge\": 123,\n \"optionsPassthrough\": true\n },\n \"pluginConfig\": {\n \"bundle\": {\n \"enabled\": true,\n \"path\": \"<string>\"\n },\n \"data\": {\n \"enabled\": true,\n \"value\": {}\n },\n \"driver\": \"<string>\"\n },\n \"postAuthenticationPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postAuthenticationPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"postPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"prePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"prePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"responsePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"responsePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"trafficLogs\": {\n \"enabled\": true\n },\n \"transformRequestHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n },\n \"transformResponseHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n }\n },\n \"operations\": {}\n },\n \"server\": {\n \"authentication\": {\n \"baseIdentityProvider\": \"<string>\",\n \"custom\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"config\": {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"idExtractor\": {\n \"config\": {\n \"formParamName\": \"<string>\",\n \"headerName\": \"<string>\",\n \"regexp\": \"<string>\",\n \"regexpMatchIndex\": 123,\n \"xPathExp\": \"<string>\"\n },\n \"enabled\": true,\n \"source\": \"<string>\",\n \"with\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"rawBodyOnly\": true\n },\n \"enabled\": true\n },\n \"enabled\": true,\n \"hmac\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"allowedAlgorithms\": [\n \"<string>\"\n ],\n \"allowedClockSkew\": 123,\n \"enabled\": true\n },\n \"oidc\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"enabled\": true,\n \"providers\": [\n {\n \"clientToPolicyMapping\": [\n {\n \"clientId\": \"<string>\",\n \"policyId\": \"<string>\"\n }\n ],\n \"issuer\": \"<string>\"\n }\n ],\n \"scopes\": {\n \"claimName\": \"<string>\",\n \"scopeToPolicyMapping\": [\n {\n \"policyId\": \"<string>\",\n \"scope\": \"<string>\"\n }\n ]\n },\n \"segregateByClientId\": true\n },\n \"securitySchemes\": {},\n \"stripAuthorizationData\": true\n },\n \"clientCertificates\": {\n \"allowlist\": [\n \"<string>\"\n ],\n \"enabled\": true\n },\n \"customDomain\": {\n \"certificates\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"detailedActivityLogs\": {\n \"enabled\": true\n },\n \"detailedTracing\": {\n \"enabled\": true\n },\n \"eventHandlers\": [\n {\n \"enabled\": true,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"gatewayTags\": {\n \"enabled\": true,\n \"tags\": [\n \"<string>\"\n ]\n },\n \"listenPath\": {\n \"strip\": true,\n \"value\": \"<string>\"\n }\n },\n \"upstream\": {\n \"certificatePinning\": {\n \"domainToPublicKeysMapping\": [\n {\n \"domain\": \"<string>\",\n \"publicKeys\": [\n \"<string>\"\n ]\n }\n ],\n \"enabled\": true\n },\n \"mutualTLS\": {\n \"domainToCertificateMapping\": [\n {\n \"certificate\": \"<string>\",\n \"domain\": \"<string>\"\n }\n ],\n \"enabled\": true\n },\n \"rateLimit\": {\n \"enabled\": true,\n \"per\": \"PT2H30M15S\",\n \"rate\": 123\n },\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n },\n \"test\": {\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n }\n },\n \"url\": \"<string>\"\n }\n },\n \"x-tyk-streaming\": {\n \"streams\": {}\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{tenant}/api/apis/streams/{apiId}")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"x-tyk-api-gateway\": {\n \"info\": {\n \"dbId\": \"<string>\",\n \"expiration\": \"<string>\",\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"orgId\": \"<string>\",\n \"state\": {\n \"active\": true,\n \"internal\": true\n },\n \"versioning\": {\n \"default\": \"<string>\",\n \"enabled\": true,\n \"fallbackToDefault\": true,\n \"key\": \"<string>\",\n \"location\": \"<string>\",\n \"name\": \"<string>\",\n \"stripVersioningData\": true,\n \"urlVersioningPattern\": \"<string>\",\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n },\n \"middleware\": {\n \"global\": {\n \"cache\": {\n \"cacheAllSafeRequests\": true,\n \"cacheByHeaders\": [\n \"<string>\"\n ],\n \"cacheResponseCodes\": [\n 123\n ],\n \"controlTTLHeaderName\": \"<string>\",\n \"enableUpstreamCacheControl\": true,\n \"enabled\": true,\n \"timeout\": 123\n },\n \"contextVariables\": {\n \"enabled\": true\n },\n \"cors\": {\n \"allowCredentials\": true,\n \"allowedHeaders\": [\n \"<string>\"\n ],\n \"allowedMethods\": [\n \"<string>\"\n ],\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"debug\": true,\n \"enabled\": true,\n \"exposedHeaders\": [\n \"<string>\"\n ],\n \"maxAge\": 123,\n \"optionsPassthrough\": true\n },\n \"pluginConfig\": {\n \"bundle\": {\n \"enabled\": true,\n \"path\": \"<string>\"\n },\n \"data\": {\n \"enabled\": true,\n \"value\": {}\n },\n \"driver\": \"<string>\"\n },\n \"postAuthenticationPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postAuthenticationPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"postPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"prePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"prePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"responsePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"responsePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"trafficLogs\": {\n \"enabled\": true\n },\n \"transformRequestHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n },\n \"transformResponseHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n }\n },\n \"operations\": {}\n },\n \"server\": {\n \"authentication\": {\n \"baseIdentityProvider\": \"<string>\",\n \"custom\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"config\": {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"idExtractor\": {\n \"config\": {\n \"formParamName\": \"<string>\",\n \"headerName\": \"<string>\",\n \"regexp\": \"<string>\",\n \"regexpMatchIndex\": 123,\n \"xPathExp\": \"<string>\"\n },\n \"enabled\": true,\n \"source\": \"<string>\",\n \"with\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"rawBodyOnly\": true\n },\n \"enabled\": true\n },\n \"enabled\": true,\n \"hmac\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"allowedAlgorithms\": [\n \"<string>\"\n ],\n \"allowedClockSkew\": 123,\n \"enabled\": true\n },\n \"oidc\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"enabled\": true,\n \"providers\": [\n {\n \"clientToPolicyMapping\": [\n {\n \"clientId\": \"<string>\",\n \"policyId\": \"<string>\"\n }\n ],\n \"issuer\": \"<string>\"\n }\n ],\n \"scopes\": {\n \"claimName\": \"<string>\",\n \"scopeToPolicyMapping\": [\n {\n \"policyId\": \"<string>\",\n \"scope\": \"<string>\"\n }\n ]\n },\n \"segregateByClientId\": true\n },\n \"securitySchemes\": {},\n \"stripAuthorizationData\": true\n },\n \"clientCertificates\": {\n \"allowlist\": [\n \"<string>\"\n ],\n \"enabled\": true\n },\n \"customDomain\": {\n \"certificates\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"detailedActivityLogs\": {\n \"enabled\": true\n },\n \"detailedTracing\": {\n \"enabled\": true\n },\n \"eventHandlers\": [\n {\n \"enabled\": true,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"gatewayTags\": {\n \"enabled\": true,\n \"tags\": [\n \"<string>\"\n ]\n },\n \"listenPath\": {\n \"strip\": true,\n \"value\": \"<string>\"\n }\n },\n \"upstream\": {\n \"certificatePinning\": {\n \"domainToPublicKeysMapping\": [\n {\n \"domain\": \"<string>\",\n \"publicKeys\": [\n \"<string>\"\n ]\n }\n ],\n \"enabled\": true\n },\n \"mutualTLS\": {\n \"domainToCertificateMapping\": [\n {\n \"certificate\": \"<string>\",\n \"domain\": \"<string>\"\n }\n ],\n \"enabled\": true\n },\n \"rateLimit\": {\n \"enabled\": true,\n \"per\": \"PT2H30M15S\",\n \"rate\": 123\n },\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n },\n \"test\": {\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n }\n },\n \"url\": \"<string>\"\n }\n },\n \"x-tyk-streaming\": {\n \"streams\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/apis/streams/{apiId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"x-tyk-api-gateway\": {\n \"info\": {\n \"dbId\": \"<string>\",\n \"expiration\": \"<string>\",\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"orgId\": \"<string>\",\n \"state\": {\n \"active\": true,\n \"internal\": true\n },\n \"versioning\": {\n \"default\": \"<string>\",\n \"enabled\": true,\n \"fallbackToDefault\": true,\n \"key\": \"<string>\",\n \"location\": \"<string>\",\n \"name\": \"<string>\",\n \"stripVersioningData\": true,\n \"urlVersioningPattern\": \"<string>\",\n \"versions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n }\n },\n \"middleware\": {\n \"global\": {\n \"cache\": {\n \"cacheAllSafeRequests\": true,\n \"cacheByHeaders\": [\n \"<string>\"\n ],\n \"cacheResponseCodes\": [\n 123\n ],\n \"controlTTLHeaderName\": \"<string>\",\n \"enableUpstreamCacheControl\": true,\n \"enabled\": true,\n \"timeout\": 123\n },\n \"contextVariables\": {\n \"enabled\": true\n },\n \"cors\": {\n \"allowCredentials\": true,\n \"allowedHeaders\": [\n \"<string>\"\n ],\n \"allowedMethods\": [\n \"<string>\"\n ],\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"debug\": true,\n \"enabled\": true,\n \"exposedHeaders\": [\n \"<string>\"\n ],\n \"maxAge\": 123,\n \"optionsPassthrough\": true\n },\n \"pluginConfig\": {\n \"bundle\": {\n \"enabled\": true,\n \"path\": \"<string>\"\n },\n \"data\": {\n \"enabled\": true,\n \"value\": {}\n },\n \"driver\": \"<string>\"\n },\n \"postAuthenticationPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postAuthenticationPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"postPlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"postPlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"prePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"prePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"responsePlugin\": {\n \"plugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ]\n },\n \"responsePlugins\": [\n {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"path\": \"<string>\",\n \"rawBodyOnly\": true,\n \"requireSession\": true\n }\n ],\n \"trafficLogs\": {\n \"enabled\": true\n },\n \"transformRequestHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n },\n \"transformResponseHeaders\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"remove\": [\n \"<string>\"\n ]\n }\n },\n \"operations\": {}\n },\n \"server\": {\n \"authentication\": {\n \"baseIdentityProvider\": \"<string>\",\n \"custom\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"config\": {\n \"enabled\": true,\n \"functionName\": \"<string>\",\n \"idExtractor\": {\n \"config\": {\n \"formParamName\": \"<string>\",\n \"headerName\": \"<string>\",\n \"regexp\": \"<string>\",\n \"regexpMatchIndex\": 123,\n \"xPathExp\": \"<string>\"\n },\n \"enabled\": true,\n \"source\": \"<string>\",\n \"with\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"rawBodyOnly\": true\n },\n \"enabled\": true\n },\n \"enabled\": true,\n \"hmac\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"allowedAlgorithms\": [\n \"<string>\"\n ],\n \"allowedClockSkew\": 123,\n \"enabled\": true\n },\n \"oidc\": {\n \"AuthSources\": {\n \"cookie\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"header\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"query\": {\n \"enabled\": true,\n \"name\": \"<string>\"\n }\n },\n \"enabled\": true,\n \"providers\": [\n {\n \"clientToPolicyMapping\": [\n {\n \"clientId\": \"<string>\",\n \"policyId\": \"<string>\"\n }\n ],\n \"issuer\": \"<string>\"\n }\n ],\n \"scopes\": {\n \"claimName\": \"<string>\",\n \"scopeToPolicyMapping\": [\n {\n \"policyId\": \"<string>\",\n \"scope\": \"<string>\"\n }\n ]\n },\n \"segregateByClientId\": true\n },\n \"securitySchemes\": {},\n \"stripAuthorizationData\": true\n },\n \"clientCertificates\": {\n \"allowlist\": [\n \"<string>\"\n ],\n \"enabled\": true\n },\n \"customDomain\": {\n \"certificates\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"name\": \"<string>\"\n },\n \"detailedActivityLogs\": {\n \"enabled\": true\n },\n \"detailedTracing\": {\n \"enabled\": true\n },\n \"eventHandlers\": [\n {\n \"enabled\": true,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"gatewayTags\": {\n \"enabled\": true,\n \"tags\": [\n \"<string>\"\n ]\n },\n \"listenPath\": {\n \"strip\": true,\n \"value\": \"<string>\"\n }\n },\n \"upstream\": {\n \"certificatePinning\": {\n \"domainToPublicKeysMapping\": [\n {\n \"domain\": \"<string>\",\n \"publicKeys\": [\n \"<string>\"\n ]\n }\n ],\n \"enabled\": true\n },\n \"mutualTLS\": {\n \"domainToCertificateMapping\": [\n {\n \"certificate\": \"<string>\",\n \"domain\": \"<string>\"\n }\n ],\n \"enabled\": true\n },\n \"rateLimit\": {\n \"enabled\": true,\n \"per\": \"PT2H30M15S\",\n \"rate\": 123\n },\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n },\n \"test\": {\n \"serviceDiscovery\": {\n \"cache\": {\n \"enabled\": true,\n \"timeout\": 123\n },\n \"cacheTimeout\": 123,\n \"dataPath\": \"<string>\",\n \"enabled\": true,\n \"endpointReturnsList\": true,\n \"parentDataPath\": \"<string>\",\n \"portDataPath\": \"<string>\",\n \"queryEndpoint\": \"<string>\",\n \"targetPath\": \"<string>\",\n \"useNestedQuery\": true,\n \"useTargetList\": true\n }\n },\n \"url\": \"<string>\"\n }\n },\n \"x-tyk-streaming\": {\n \"streams\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"Message": "API updated",
"Meta": null,
"Status": "OK"
}{
"Message": "Invalid `ID` value",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to update org object to DB.",
"Meta": null,
"Status": "Error"
}{
"Message": "API not found.",
"Meta": null,
"Status": "Error"
}Authorizations
The Tyk Dashboard API Access Credentials
Headers
Content type for streams endpoints should be application/vnd.tyk.streams.oas
application/vnd.tyk.streams.oas Path Parameters
ID of the API you want to patch.
Query Parameters
Listen path for the API.
Custom domain for the API.
Enable allowList middleware for all endpoints.
true, false true
Enable validateRequest middleware for all endpoints having a request body with media type application/json.
true, false true
Enable mockResponse middleware for all endpoints having responses configured.
true, false true
Enable/disable the authentication mechanism in your Tyk Gateway for your OAS API.
true, false true
Body
The content of the file should be the OpenAPI document in JSON format.
Was this page helpful?